summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-02-22 14:16:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-02-22 14:16:06 +0000
commitd98b056a1e6b58d598364089dd1c4660468c36a0 (patch)
treeaa8ef5e65dd55e9c4df9117be642d0910060031a /perl-install
parenta0d4ac60dc373d2f18d9861087e0054d4e8f865d (diff)
downloaddrakx-d98b056a1e6b58d598364089dd1c4660468c36a0.tar
drakx-d98b056a1e6b58d598364089dd1c4660468c36a0.tar.gz
drakx-d98b056a1e6b58d598364089dd1c4660468c36a0.tar.bz2
drakx-d98b056a1e6b58d598364089dd1c4660468c36a0.tar.xz
drakx-d98b056a1e6b58d598364089dd1c4660468c36a0.zip
(create_box_with_title): disallow focusing on text if it is non-scrolled
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/my_gtk.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 749ae9aa4..a387c83a8 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -307,9 +307,15 @@ sub create_box_with_title($@) {
$o->{box} = new Gtk::VBox(0,0);
if (@_ <= 2 && $nb_lines > 4) {
my $font = $o->{box}->style->font;
+ my $wanted = $nb_lines * ($font->ascent + $font->descent) + 7;
+ my $height = min(250, $wanted);
+ my $has_scroll = $height < $wanted;
+
+ my $wtext = new Gtk::Text;
+ $wtext->can_focus($has_scroll);
chomp(my $text = join("\n", @_));
- my $scroll = createScrolledWindow(gtktext_insert(new Gtk::Text, $text));
- $scroll->set_usize(400, min(250, $nb_lines * ($font->ascent + $font->descent) + 7));
+ my $scroll = createScrolledWindow(gtktext_insert($wtext, $text));
+ $scroll->set_usize(400, $height);
gtkpack__($o->{box}, $scroll);
} else {
gtkpack__($o->{box},