summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-19 20:23:15 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-19 20:23:15 +0000
commit19ca59fe329e6cb97cc3681e70c12d81a022dbcc (patch)
tree63854174408e6a69b7735815d35d053dafc4e8c9 /perl-install/my_gtk.pm
parent25f65beed0677fa247c513705dbf538225f979c4 (diff)
downloaddrakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.gz
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.bz2
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.xz
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.zip
no_comment
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm31
1 files changed, 23 insertions, 8 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 30406cac0..bd822f67b 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -7,7 +7,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title) ],
- wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkappend gtkadd gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background gtkset_default_fontset) ],
+ wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkappend gtkadd gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background gtkset_default_fontset) ],
ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ask_file) ],
);
$EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ];
@@ -126,6 +126,14 @@ sub gtkadd($@) {
$w
}
+sub gtktext_insert($$) {
+ my ($w, $t) = @_;
+ $w->insert(undef, undef, undef, "$t\n"); #- needs \n otherwise in case of one line text the beginning is not shown (even with the vadj->set_value)
+ $w->set_word_wrap(1);
+ $w->vadj->set_value(0);
+ $w;
+}
+
sub gtkroot {
Gtk->init;
Gtk::Gdk::Window->new_foreign(Gtk::Gdk->ROOT_WINDOW);
@@ -200,13 +208,20 @@ sub create_box_with_title($@) {
}
sub createScrolledWindow($) {
- my $w = new Gtk::ScrolledWindow(undef, undef);
- $w->set_policy('automatic', 'automatic');
- member(ref $_[0], qw(Gtk::CList)) ?
- $w->add($_[0]) :
- $w->add_with_viewport($_[0]);
- $_[0]->show;
- $w
+ my ($W) = @_;
+ if (ref $W eq "Gtk::Text") {
+ gtkpack_(new Gtk::HBox(0,0),
+ 1, $W,
+ 0, new Gtk::VScrollbar($W->vadj));
+ } else {
+ my $w = new Gtk::ScrolledWindow(undef, undef);
+ $w->set_policy('automatic', 'automatic');
+ member(ref $W, qw(Gtk::CList)) ?
+ $w->add($W) :
+ $w->add_with_viewport($W);
+ $W->show;
+ $w
+ }
}
sub create_menu($@) {