From db4f69a8272af9dc19fa360dcee4e2e47ef59156 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 22 Sep 2008 13:33:05 +0000 Subject: (create_step_box) factorize code --- perl-install/install/gtk.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'perl-install/install/gtk.pm') diff --git a/perl-install/install/gtk.pm b/perl-install/install/gtk.pm index 8f2a74785..1655f6743 100644 --- a/perl-install/install/gtk.pm +++ b/perl-install/install/gtk.pm @@ -104,6 +104,12 @@ sub install_theme { $root_window = $win; } +sub create_step_box { + gtknew('HBox', spacing => 7, children => [ + @_, + ]); +} + #------------------------------------------------------------------------------ my %steps; sub create_steps_window { @@ -112,11 +118,12 @@ sub create_steps_window { $o->{steps_window} and $o->{steps_window}->destroy; $steps{$_} ||= gtknew('Pixbuf', file => "steps_$_") foreach qw(on off done); + my $category = sub { - gtknew('HBox', spacing => 7, children => [ + create_step_box( 1, gtknew('Label_Right', text_markup => '' . uc($_[0]) . '', widget_name => 'Step-categories'), 0, gtknew('Image', file => 'steps_off.png'), - ]); + ); }; my @l = ( @@ -128,10 +135,10 @@ sub create_steps_window { } my $img = gtknew('Image', file => 'steps_off.png'); $steps{steps}{$_}{img} = $img; - push @l, gtknew('HBox', spacing => 7, children => [ + push @l, create_step_box( 1, $steps{steps}{$_}{text} = gtknew('Label_Right', text => translate($o->{steps}{$_}{text})), 0, $img, - ]); + ); } my $offset = 10; -- cgit v1.2.1