From bace90ec0d5b0d68cd8786ef1077628a03d567fe Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 11 Feb 2008 19:26:50 +0000 Subject: (_gtk__Sexy_IconEntry) add support for Gtk2::Sexy::IconEntry (needed for rpmdrake) --- perl-install/NEWS | 1 + perl-install/mygtk2.pm | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'perl-install') diff --git a/perl-install/NEWS b/perl-install/NEWS index 9f4d56213..2a9f9d8e5 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,4 @@ +- add support for Gtk2::Sexy::IconEntry (needed for rpmdrake) - drakperm: o warning dialogs are confusing since OK/cancel both ends in cancel, let's offer only a cancel button diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 73007dc72..f3c1d44aa 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -388,6 +388,30 @@ sub _gtk__Title2 { _gtk__Title1($w, $opts); } +sub _gtk__Sexy_IconEntry { + my ($w, $opts) = @_; + + require Gtk2::Sexy; + if (!$w) { + $w = Gtk2::Sexy::IconEntry->new; + $w->set_editable(delete $opts->{editable}) if exists $opts->{editable}; + } + + $w->add_clear_button if delete $opts->{clear_button}; + if (my $icon = delete $opts->{primary_icon}) { + $w->set_icon('primary', $icon); + $w->set_icon_highlight('primary', $icon); + } + if (my $icon = delete $opts->{secondary_icon}) { + $w->set_icon('secondary',i $icon); + $w->set_icon_highlight('secondary', $icon); + } + + $w->signal_connect('icon-released' => delete $opts->{'icon-released'}) if exists $opts->{'icon-released'}; + + _gtk__Entry($w, $opts); +} + sub _gtk__Entry { my ($w, $opts) = @_; -- cgit v1.2.1