gtk.filechooser problems...



Hi all,


I am trying to call a filechooser, run it, then get the filename from
it.

This following code is an example from:
http://developer.gnome.org/gnome-devel-demos/stable/image-viewer.js.html.en
-------------------------------------------------------------------
var chooser = new Gtk.FileChooserDialog ({title: "Select an image",
                                          action:
                                          Gtk.FileChooserAction.OPEN,
					  transient_for: null,
                                          modal: true});
chooser.add_button (Gtk.STOCK_CANCEL, 0);
chooser.add_button (Gtk.STOCK_OPEN, 1);
chooser.set_default_response (1);
    
//var filter = new Gtk.FileFilter ();
//filter.add_pixbuf_formats ();
//chooser.filter = filter;

let file;

if (chooser.run () == 1) {
	file = chooser.get_filename ();
}
chooser.destroy ();
---------------------------------------------------------------------

All is well if I instantiate and destroy the Gtk.FileChooserDialog but
when I try to open the filechooser with chooser.run() the whole desktop
locks (not only the gnome shell) and I have to CTRL-ALT-BACKSPACE to
unlock and return to the display manager, so that I can re-login.

Is there a bug known to give that behaviour?
Or am I just making mistakes?

Are there any extensions that proper use the Gtk.FileChooserDialog?


-- 
(o_
//\  Regards, Groeten,
V_/_ Bas Burger.


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