From fc147800e336d2e0b7785b162174bce959cf7faa Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 1 Sep 2008 15:41:12 +0000 Subject: (add_padding) factorize code for next commits --- perl-install/interactive/gtk.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'perl-install/interactive') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 6d3f10c17..2030bab14 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -352,6 +352,14 @@ sub add_modify_remove_action { 1; } +sub add_padding { + my ($w) = @_; + gtknew('HBox', children => [ + 0, gtknew('Alignment', width => $mygtk2::left_padding), + 1, $w + ]); +} + sub create_widget { my ($o, $e, $onchange_f, $update, $ignore_ref) = @_; @@ -385,11 +393,7 @@ sub create_widget { } $w->signal_connect(clicked => $onchange->(sub { $w->get_active })); $set = sub { $w->set_active($_[0]) }; - $real_w = gtknew('HBox', children => [ - 0, gtknew('Alignment', width => $mygtk2::left_padding), - 1, $w - ]); - + $real_w = add_padding($w); } elsif ($e->{type} eq 'only_label') { $w = $e->{title} ? gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}}), -- cgit v1.2.1