Re: File Selector




Gabor Szabo said:
Thanks for the ointer to the Gtk2::FileChooserDialog.
I am including here a working example so that you can tell me if it is ok that
I used the simple keywords "open", "cancel" and "accept" instead on the
GTK_FILE_CHOOSER_ACTION_OPEN and similar constants.

The action constants are fine --- both the nicknames and the full names are
accepted.  Check the Gtk2::enums manpage, and the enums section in Gtk2::api.


If that's OK then someone might want to put in the examples directory in CVS.

There's one there already.  Gtk2/examples/file_chooser.pl even shows how to
use a preview widget.

http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/examples/file_chooser.pl?rev=1.8&view=auto


sub file_selector {
      my $f = Gtk2::FileChooserDialog->new("FS", $window, "open",
                              "Cancel" => "cancel",
                              "OK"     => "accept",
                                      );

In general, you and your users will find it more satifying to use stock ids
for your buttons.

      my $f = Gtk2::FileChooserDialog->new("FS", $window, "open",
                              "gtk-cancel" => "cancel",
                              "gtk-open"   => "accept",
                                      );

(note use of 'gtk-open' instead of 'gtk-ok' --- a subtle hint to help the user
not wonder what will happen when he clicks "Ok".)


-- 
muppet <scott at asofyet dot org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]