From 7db3710114c361ad7bd74642c02f7920c455da9a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Oct 2009 16:22:55 +0000 Subject: factorize in button_activate helper --- perl-install/fs/partitioning_wizard.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index 99d87e72a..a68038cca 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -365,6 +365,10 @@ sub create_display_box { $part->{req_size} = int($hpane->get_position * $part->{size} / $part->{width}); $update_size_labels->(); }; + my $button_activate = sub { + $button->activate; + 0; + }; $hpane->signal_connect('size-allocate' => sub { my (undef, $alloc) = @_; $update_req_size->(); @@ -372,14 +376,8 @@ sub create_display_box { $update_size_labels->(); $hpane->signal_connect('motion-notify-event' => $update_req_size); $hpane->signal_connect('move-handle' => $update_req_size); - $hpane->signal_connect('button-press-event' => sub { - $button->activate; - 0; - }); - $vbox->signal_connect('button-press-event' => sub { - $button->activate; - 0; - }); + $hpane->signal_connect('button-press-event' => $button_activate); + $vbox->signal_connect('button-press-event' => $button_activate); $button->signal_connect('focus-in-event' => sub { $hpane->grab_focus; 0; -- cgit v1.2.1