Re: Gtk2::FileChooserDialog



I have a simple dialog with a text entry, some little things and an OK button.

When I'm in the Gtk2::Entry box, typing, and hit Enter, it seems to me it aught to click OK for me since I set the set_default_response for the Gtk2::Dialog.  If I'm sitting on the Gtk2::CheckButton next to it, hitting enter submits the form...

And I noticed that in the Entry box for FileChooserDialog s, enter submits the default response for the dialog.  So there must be some way to connect the Entry widget to the dialog.  How is that done?

I imagine it has something to do with the accel path, but it appears over my head.




A couple months ago, I asked this and the demo provided by muppet is relevant.

On Wed, May 7, 2008 at 10:15 PM, muppet <scott asofyet org> wrote:
The dialog doesn't activate when I hit enter from the location

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;



--
If riding in an airplane is flying, then riding in a boat is swimming.
85 jumps, 36.0 minutes of freefall, 69.1 freefall miles.


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