[Glade-users] How to use libglade

Joaquin Cuenca Abela e98cuenc@free.fr
Wed, 7 May 2003 18:25:12 +0200


> -----Message d'origine-----
> De : glade-users-admin@lists.ximian.com=20
> [mailto:glade-users-admin@lists.ximian.com] De la part de=20
> Cletus Lichte
> Envoy=E9 : mercredi 7 mai 2003 05:32
> =C0 : glade-users@ximian.com
> Objet : [Glade-users] How to use libglade
>=20
>=20
> Hello all,
>=20
> I've designed an interface with a GtkTreeView and a toolbar and a=20
> dialog window for an about dialog.  I saved the file and I'm using=20
> Anjuta-HEAD to code in.  Everything compiles and runs just fine but I=20
> have 2 questions about programming with libglade.
>=20
> 1.  How do I access the GtkTreeView in code?  What I mean is,=20
> there are=20
> only a couple lines of code to get the program to run when I use=20
> libglade but there are no headings in the tree view and no way to set=20
> them in the Glade interface builder.  So how do I make changes to the=20
> GtkTreeView?  Do I have to change the XML file or is there way to=20
> access widgets with code?  As you can tell, this is my first=20
> time with=20
> Glade and libglade so if someone can point me to a web page or a=20
> project that uses libglade I'd appreciate it.  Maybe I should=20
> just have=20
> glade generate the code so that I can learn, but I keep reading that=20
> the next version of glade will not have the code generation so I'm=20
> trying to learn libglade.  I've read everything that comes with glade=20
> and libglade and Anjuta but I don't find anything beyond how to get a=20
> libglade file to compile and run.

You can use glade_xml_get_widget to access your GtkTreeView and then do
whatever you want with it.  Look at the GtkTreeView documentation
(http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeView.html).

Even if you use glade & anjuta you will have to learn the gtk API to
modify the tree view.

>=20
> 2.  When I start the program, the dialog box *always* starts with the=20
> program instead of only when I click the "About" button. When=20
> I cancel=20
> the dialog and click on the "About" button, it works just=20
> fine but how=20
> do I get it to not start up when I run the program?

You have to put the undesired window "visibility" property to false on
glade.  Otherwise libglade will show this window on startup.

Cheers,