Re: Gtk2::FileChooserDialog




On May 6, 2008, at 9:51 AM, Paul Miller wrote:

On the file choosers, when you hit ctrl-L to enter a location
manually and type in a file, most applications allow me to hit
enter to emit a "file-activated" signal.

The dialog doesn't activate when I hit enter from the location
popup for me in my perl5.8 Gtk2-1.162 and I don't see a way to
add it.

Did you set a default response on the dialog?

#!/usr/bin/perl -w

use strict;
use Gtk2 -init;


my $d = Gtk2::FileChooserDialog->new ("whee", undef, "open",
                                      'gtk-cancel' => 'cancel',
                                      'gtk-open' => 'ok');
$d->set_default_response ('ok');

if ('ok' eq $d->run ()) {
        print "chose ".$d->get_filename()."\n";
}

$d->destroy;

__END__

--
Doing a good job around here is like wetting your pants in a dark suit; you get a warm feeling, but no one notices.
  -- unknown





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