summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-31 20:04:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-31 20:04:11 +0000
commit8b5271483157d2e747db5dcdd8624ee4b5705fff (patch)
tree4233d550f3d6334b805988387e04b75cd82088e6 /perl-install
parent12ee9c30c5bb816149965789cc8d6be21715a835 (diff)
downloaddrakx-8b5271483157d2e747db5dcdd8624ee4b5705fff.tar
drakx-8b5271483157d2e747db5dcdd8624ee4b5705fff.tar.gz
drakx-8b5271483157d2e747db5dcdd8624ee4b5705fff.tar.bz2
drakx-8b5271483157d2e747db5dcdd8624ee4b5705fff.tar.xz
drakx-8b5271483157d2e747db5dcdd8624ee4b5705fff.zip
(create_box_with_title): create an empty box when there is no message
(also don't set $o->{box} since unused outside of this function)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/my_gtk.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index a7d67f993..0333123bf 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -736,11 +736,13 @@ sub create_box_with_title($@) {
my $o = shift;
my $nbline = sum(map { round(length($_) / 60 + 1/2) } map { split "\n" } @_);
- $o->{box} = new Gtk::VBox(0,0);
- $o->{box_size} = n_line_size($nbline, 'text', $o->{box});
+ my $box = new Gtk::VBox(0,0);
+ return $box if $nbline == 0;
+
+ $o->{box_size} = n_line_size($nbline, 'text', $box);
if (@_ <= 2 && $nbline > 4) {
$o->{icon} && !$::isWizard and
- eval { gtkpack__($o->{box}, gtkset_border_width(gtkpack_(new Gtk::HBox(0,0), 1, gtkpng($o->{icon})),5)) };
+ eval { gtkpack__($box, gtkset_border_width(gtkpack_(new Gtk::HBox(0,0), 1, gtkpng($o->{icon})),5)) };
my $wanted = $o->{box_size};
$o->{box_size} = min(200, $o->{box_size});
my $has_scroll = $o->{box_size} < $wanted;
@@ -750,12 +752,12 @@ sub create_box_with_title($@) {
chomp(my $text = join("\n", @_));
my $scroll = createScrolledWindow(gtktext_insert($wtext, $text));
$scroll->set_usize(400, $o->{box_size});
- gtkpack__($o->{box}, $scroll);
+ gtkpack__($box, $scroll);
} else {
my $a = !$::no_separator;
undef $::no_separator;
if ($o->{icon} && !$::isWizard) {
- gtkpack__($o->{box},
+ gtkpack__($box,
gtkpack_(new Gtk::HBox(0,0),
0, gtkset_usize(new Gtk::VBox(0,0), 15, 0),
0, eval { gtkpng($o->{icon}) },
@@ -774,7 +776,7 @@ sub create_box_with_title($@) {
if_($a, new Gtk::HSeparator)
)
} else {
- gtkpack__($o->{box},
+ gtkpack__($box,
(map {
my $w = ref $_ ? $_ : new Gtk::Label($_);
$::isWizard and $w->set_justify("left");