Gtk2::FileChooserDialog

View: New views
5 Messages — Rating Filter:   Alert me  

Gtk2::FileChooserDialog

by Paul Miller-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a hopefully simple question about Gtk2::FileChooserDialog
windows.

It seems most of my gnome applications have a desired behavior
that I can't figure out in my Gtk2.pm application.

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.

If I could get to the widget, I could probably add an accelerator
or something as a workaround, but I don't even see a way to get
that far.

--
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.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: Gtk2::FileChooserDialog

by muppet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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


_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: Gtk2::FileChooserDialog

by Paul Miller-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, May 07, 2008 at 10:15:25PM -0400, muppet wrote:
>> 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?

I certainly thought I did, but upon checking I did not.

> $d->set_default_response ('ok');

This is all I needed.  Sorry about that.

--
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.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: Gtk2::FileChooserDialog

by Paul Miller-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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.

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: Gtk2::FileChooserDialog

by muppet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 9, 2008, at 7:21 AM, Paul Miller wrote:

> 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?


   $entry->set_activates_default (TRUE);


http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/Entry.html#_entry_set_activates

http://library.gnome.org/devel/gtk/stable/GtkEntry.html#gtk-entry-set-activates-default


--
Leia/Lois:  Aren't you a little fat for a stormtrooper?
Luke/Chris: Well, stay here and rot, you stuck-up bitch.
   -- Family Guy, "Blue Harvest" (A "Star Wars" parody)

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
LightInTheBox - Buy quality products at wholesale price