Delivered-To: lablgtk at yquem.inria.fr Date: Fri, 25 Jul 2008 09:48:04 +0900 (JST) Message-Id: <20080725.094804.191378614.garrigue at math.nagoya-u.ac.jp> To: matthieu.dubuget at gmail.com Subject: Re: [Lablgtk] filechooserwidget From: Jacques Garrigue In-Reply-To: <4888E9FC.6080500 at gmail.com> References: <4888E9FC.6080500 at gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: lablgtk at yquem.inria.fr Content-Type: Text/Plain; charset=us-ascii Content-Length: 1050 From: Matthieu Dubuget > I'm trying to get access to a GFile.chooser_widget from a .glade file. > > For this, I would need to convert the > > Gtk.widget Gtk.obj > > returned by > > Glade.get_widget ~name:"filechooserwidget" xmldata > > into a > > ([> `filechooser | `gtk | `widget ] as 'a) Gtk.obj > > > But I really don't know how to do this. The standard way to do this is to use the function GtkFile.FileChooser.cast, which checks that your widget is really a file chooser. Unfortunately, there seems to be a bug, and the returned type is not correct (it contains only `filechooser, not `gtk and `widget), so you will have to call also Gobject.unsafe_cast. The whole command would look like let fcw = GtkFile.FileChooser.cast (Glade.get_widget ~name:"filechooserwidget" xmldata) in new GFile.chooser_widget (Gobject.unsafe_cast fcw) Jacques _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk