diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-12-17 12:13:49 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-12-17 12:13:49 +0000 |
commit | d9a91c227c295a8caacb4340fb94a5af5ed0fa3d (patch) | |
tree | 2d0dcf0b646abe4e1c1e3eaaee0683744bd6dc17 /perl-install/ugtk2.pm | |
parent | e87951e4e1efca128c0ff719ae23b37d4217c270 (diff) | |
download | drakx-d9a91c227c295a8caacb4340fb94a5af5ed0fa3d.tar drakx-d9a91c227c295a8caacb4340fb94a5af5ed0fa3d.tar.gz drakx-d9a91c227c295a8caacb4340fb94a5af5ed0fa3d.tar.bz2 drakx-d9a91c227c295a8caacb4340fb94a5af5ed0fa3d.tar.xz drakx-d9a91c227c295a8caacb4340fb94a5af5ed0fa3d.zip |
add some more functions in mygtk2
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r-- | perl-install/ugtk2.pm | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index a15dbda08..014d7f967 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -51,7 +51,7 @@ $border = 5; # variables, and second, to "see" directly in the code the user interface # you're building. -sub gtkdestroy { $_[0] and $_[0]->destroy } +sub gtkdestroy { mygtk2::may_destroy($_[0]) } sub gtkflush() { mygtk2::flush() } sub gtkhide { $_[0]->hide; $_[0] } sub gtkmove { $_[0]->window->move($_[1], $_[2]); $_[0] } @@ -146,10 +146,9 @@ sub gtkradio { map { gtkset_active($radio = Gtk2::RadioButton->new_with_label($radio ? $radio->get_group : undef, $_), $_ eq $def) } @_; } -sub gtkroot() { - my $root if 0; - $root ||= Gtk2::Gdk->get_default_root_window; -} +sub gtkroot() { mygtk2::root_window() } +sub gtkcolor { &mygtk2::rgb2color } +sub gtkset_background { &mygtk2::set_root_window_background } sub gtkset_text { my ($w, $s) = @_; @@ -814,24 +813,6 @@ sub wrap_paragraph { return @lines; } -sub gtkcolor { - my ($r, $g, $b) = @_; - my $color = Gtk2::Gdk::Color->new($r, $g, $b); - gtkroot()->get_colormap->rgb_find_color($color); - $color; -} - -sub gtkset_background { - my ($r, $g, $b) = @_; - my $root = gtkroot(); - my $gc = Gtk2::Gdk::GC->new($root); - my $color = gtkcolor($r, $g, $b); - $gc->set_rgb_fg_color($color); - $root->set_background($color); - my ($w, $h) = $root->get_size; - $root->draw_rectangle($gc, 1, 0, 0, $w, $h); -} - # -=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=--- # toplevel window creation helper |