diff options
author | damien <damien@mandriva.com> | 2002-09-03 13:15:36 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2002-09-03 13:15:36 +0000 |
commit | 873ec292ff6883cdd36c718d680c72faf05ab065 (patch) | |
tree | 9de85aa66724a8d264d458c8e0dd95ba91e56c2e | |
parent | 60903049d0f5879a75c70d53933684ceca5d8e55 (diff) | |
download | drakx-backup-do-not-use-873ec292ff6883cdd36c718d680c72faf05ab065.tar drakx-backup-do-not-use-873ec292ff6883cdd36c718d680c72faf05ab065.tar.gz drakx-backup-do-not-use-873ec292ff6883cdd36c718d680c72faf05ab065.tar.bz2 drakx-backup-do-not-use-873ec292ff6883cdd36c718d680c72faf05ab065.tar.xz drakx-backup-do-not-use-873ec292ff6883cdd36c718d680c72faf05ab065.zip |
added create_pixbutton
-rw-r--r-- | perl-install/my_gtk.pm | 20 | ||||
-rw-r--r-- | perl-install/ugtk.pm | 7 |
2 files changed, 19 insertions, 8 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 3d74d81a7..1a3eaed52 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 create_treeitem) ], - wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtkpowerpack gtkset_editable gtksetstyle gtkset_tip gtkappenditems gtkappend gtkset_shadow_type gtkset_layout gtkset_relief gtkadd gtkput gtktext_insert gtkset_usize gtksize gtkset_justify gtkset_active gtkset_sensitive gtkset_modal gtkset_border_width gtkmove gtkresize gtkshow gtkhide gtkdestroy gtkcolor gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng create_pix_text get_text_coord fill_tiled gtkicons_labels_widget write_on_pixmap gtkcreate_xpm gtkcreate_png gtkbuttonset gtkroot gtkentry) ], + wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtkpowerpack gtkset_editable gtksetstyle gtkset_tip gtkappenditems gtkappend gtkset_shadow_type gtkset_layout gtkset_relief gtkadd gtkput gtktext_insert gtkset_usize gtksize gtkset_justify gtkset_active gtkset_sensitive gtkset_modal gtkset_border_width gtkmove gtkresize gtkshow gtkhide gtkdestroy gtkcolor gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng create_pix_text get_text_coord fill_tiled gtkicons_labels_widget write_on_pixmap gtkcreate_xpm gtkcreate_png gtkbuttonset create_pixbutton gtkroot gtkentry) ], ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_browse_tree_info ask_browse_tree_info_given_widgets ask_dir) ], various => [ qw (add_icon_path) ], ); @@ -155,20 +155,26 @@ END { &exit() } sub create_okcancel { my ($w, $ok, $cancel, $spread, @other) = @_; + print "[ $w, $ok, $cancel, $spread ]\n"; $spread ||= $::isWizard ? "end" : "spread"; - $cancel = $::isWizard ? _("<- Previous") : _("Cancel") if !defined $cancel && !defined $ok; - $ok = $::isWizard ? ($::Wizard_finished ? _("Finish") : _("Next ->")) : _("Ok") if !defined $ok; - my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), clicked => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit }); - my $b2 = $cancel && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit }); - $::isWizard and gtksignal_connect($w->{wizcancel} = new Gtk::Button(_("Cancel")), clicked => sub { die 'wizcancel' }); + my $cancel_xpm= gtkxpm($::isWizard ? 'stock_left.xpm' : 'stock_cancel.xpm') if !defined $cancel && !defined $ok; + print "cancel_xpm $cancel_xpm\n"; + $cancel = $::isWizard ? _("Previous") : _("Cancel") if !defined $cancel && !defined $ok; + my $ok_xpm= gtkxpm($::isWizard ? ($::Wizard_finished ? 'stock_exit.xpm' : 'stock_right.xpm') : 'stock_ok.xpm') if !defined $ok; + print "ok_xpm $ok_xpm\n"; + $ok = $::isWizard ? ($::Wizard_finished ? _("Finish") : _("Next")) : _("Ok") if !defined $ok; + my $b1 = gtksignal_connect($w->{ok} = create_pixbutton($ok, $ok_xpm, $::isWizard), clicked => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit }); + my $b2 = $cancel && gtksignal_connect($w->{cancel} = create_pixbutton($cancel, $cancel_xpm), + clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit }); + $::isWizard and gtksignal_connect($w->{wizcancel} = create_pixbutton(_("Cancel"), gtkxpm('stock_cancel.xpm')), clicked =>sub{die'wizcancel'}); my @l = grep { $_ } $::isWizard ? ($w->{wizcancel}, $::Wizard_no_previous ? () : $b2, $b1): ($b1, $b2); push @l, map { gtksignal_connect(new Gtk::Button($_->[0]), clicked => $_->[1]) } @other; $_->can_default($::isWizard) foreach @l; + gtkadd(create_hbox($spread), @l); } - sub _create_window($$) { my ($o, $title) = @_; my $w = new Gtk::Window; diff --git a/perl-install/ugtk.pm b/perl-install/ugtk.pm index 293f5e807..02b5ca321 100644 --- a/perl-install/ugtk.pm +++ b/perl-install/ugtk.pm @@ -7,7 +7,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border); @ISA = qw(Exporter); %EXPORT_TAGS = ( helpers => [ qw(createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ], - wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtkpowerpack gtkcombo_setpopdown_strings gtkset_editable gtksetstyle gtkset_text gtkset_tip gtkappenditems gtkappend gtkset_shadow_type gtkset_layout gtkset_relief gtkadd gtkexpand gtkput gtktext_insert gtkset_usize gtksize gtkset_justify gtkset_active gtkset_sensitive gtkset_modal gtkset_border_width gtkmove gtkresize gtkshow gtkhide gtkdestroy gtkflush gtkcolor gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng create_pix_text get_text_coord fill_tiled gtkicons_labels_widget write_on_pixmap gtkcreate_xpm gtkcreate_png gtkcreate_png_pixbuf gtkbuttonset gtkroot gtkentry compose_with_back) ], + wrappers => [ qw(gtksignal_connect gtkradio gtkpack gtkpack_ gtkpack__ gtkpack2 gtkpack3 gtkpack2_ gtkpack2__ gtkpowerpack gtkcombo_setpopdown_strings gtkset_editable gtksetstyle gtkset_text gtkset_tip gtkappenditems gtkappend gtkset_shadow_type gtkset_layout gtkset_relief gtkadd gtkexpand gtkput gtktext_insert gtkset_usize gtksize gtkset_justify gtkset_active gtkset_sensitive gtkset_modal gtkset_border_width gtkmove gtkresize gtkshow gtkhide gtkdestroy gtkflush gtkcolor gtkset_mousecursor gtkset_mousecursor_normal gtkset_mousecursor_wait gtkset_background gtkset_default_fontset gtkctree_children gtkxpm gtkpng create_pix_text get_text_coord fill_tiled gtkicons_labels_widget write_on_pixmap gtkcreate_xpm gtkcreate_png gtkcreate_png_pixbuf gtkbuttonset create_pixbutton gtkroot gtkentry compose_with_back) ], various => [ qw(add2notebook add_icon_path n_line_size) ], ); $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ]; @@ -116,6 +116,11 @@ sub gtkbuttonset { gtkadd($_[0], gtkshow($_[1])) } +sub create_pixbutton { + my ($label, $pix, $reverse_order) = @_; + gtkadd(new Gtk::Button(), gtkpack_(new Gtk::HBox(0, 3), 1, "", $reverse_order ? (0, $label, $pix ? (0, $pix) : ()) : ($pix ? (0, $pix) : (), 0, $label), 1, "" )); +} + sub gtkentry { my ($text) = @_; my $e = new Gtk::Entry; |