Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=SASfVkg/d6iGCtUXoGOCik9PYuC+59ZjO1VAaO6ICuA=; b=a9Q2tZ2k5N6sfAY5OCP7/CRZ2hmfbvink6KDMdp29Ih1Z6sS60wQr19lokpJsjOmRV jFKhBnVuV7PYr+Tlw2dYmMNdaLFTw9l0KfOw514fH1SvDMPzBiPsWV6YmdF+sE//gBpN q3b/5HyB/OsGupYL8bXsiD6C9ob1Vyni7Ok4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=jlEbZkR3yBytH0/aThMlocX7ZUlUPu3/6TdklcL3UilVqw8R8B87ceGJPZrgjtF7Mz 80c3VZdTbM3RWsE1PXwBYyAkvqEYWEehu/oPjh0HeVU7snxjp83YoLqQmQjWFkU0SplR aUIuCS/sgUgem1fHtx0o0iKQ2carVRua7w4dc= Message-ID: <48897F28.5050207 at gmail.com> Date: Fri, 25 Jul 2008 09:22:16 +0200 From: Matthieu Dubuget MIME-Version: 1.0 To: Jacques Garrigue Subject: Re: [Lablgtk] filechooserwidget References: <4888E9FC.6080500 at gmail.com> <20080725.094804.191378614.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20080725.094804.191378614.garrigue at math.nagoya-u.ac.jp> Content-Transfer-Encoding: quoted-printable Cc: lablgtk at yquem.inria.fr Reply-To: matthieu.dubuget at gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 1327 Jacques Garrigue a =E9crit : > From: Matthieu Dubuget > > =20 >> 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. >> =20 > > 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 =3D GtkFile.FileChooser.cast > (Glade.get_widget ~name:"filechooserwidget" xmldata) in > new GFile.chooser_widget (Gobject.unsafe_cast fcw) > > Jacques > =20 Thanks a lot Jacques. It works now with: let fcw =3D Glade.get_widget ~name:"filechooserwidget" xmldata in new GFile.chooser_widget (Gobject.unsafe_cast fcw) Salutations Matt _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk