Re: Gtk2::FileChooserButton: strange behaviour when pasting location



You are right, thanks.


Am Sonntag, den 17.10.2010, 11:20 -0500 schrieb Jeremy Volkening:
On Sun, 2010-10-17 at 15:22 +0200, Mario Kemper wrote:
There seems to be a bug in Gtk2::FileChooserButton when pasting
locations instead of selecting them manually.

Here are the steps to reproduce:
1) Create a new folder
mkdir -p /tmp/test/dir/
2) Copy the string "/tmp/test/dir/" to clipboard and run my example
application (attached)
3) Click on the widget and select "Other..."
4) Paste the location into the address bar and hit enter
5) Signal "current-folder-changed" is emitted but home directory is
still current folder (the widget shows "dir" instead)

Is this a bug or am I doing something very wrong here?

I don't think it's a bug. The documentation for 'get_current_folder'
says:

"Note that this is the folder that the file chooser is currently
displaying (e.g. "/home/username/Documents"), which is not the same as
the currently-selected folder if the chooser is in
GTK_FILE_CHOOSER_SELECT_FOLDER mode"

In other words, you're getting the directory that's last displayed when
you close the dialog and not the one that's associated with your button.
Since you're typing and not clicking, the displayed directory doesn't
change.

I think you want either:

$saveDir_button->get_filename
or
$saveDir_button->get_uri

depending on how you want it formatted. Hope this helps.

Jeremy


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




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





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