[Glade-users] How to use libglade



Hi, 

this is a quick answer to your quesion, cause I'm on my way to work
right now.

in your example to create a treeview and be able to control it what you
have to remember is that glade can't really know what you want to put
into the treeview since it doesnt let you change that kind of
information, hoping it will in the future, cause that would be helpful. 
What it does do, is tree a blank treeview for you to retrieve from glade
using the function 

"glade_xml_get_widget(xmlfile,"WidgetName")"

what I would do is this, take some treeview code you have got previously
either made by yourself or someone else, doesnt matter.

you'll notice they create a GtkTreeView *tree = gtk_tree_.... and
instead of creating a treeview in this piece of code, you simply
retrieve the already created treeview from glade using
glade_xml_get_widget(...)  Once you have replaced that one line of code
in your working treeview code with the line to retrieve the tree view
from glade, you should find your code will work ok.

it's a pain, I'm hopeful that glade 3.0 will have proper support for
treeviews and let me do all this code internally, but right now, this is
how you do it.

ok, so have fun and get coding.

kosh

On Wed, 2003-05-07 at 04:31, Cletus Lichte wrote:
Hello all,

I've designed an interface with a GtkTreeView and a toolbar and a 
dialog window for an about dialog.  I saved the file and I'm using 
Anjuta-HEAD to code in.  Everything compiles and runs just fine but I 
have 2 questions about programming with libglade.

1.  How do I access the GtkTreeView in code?  What I mean is, there are 
only a couple lines of code to get the program to run when I use 
libglade but there are no headings in the tree view and no way to set 
them in the Glade interface builder.  So how do I make changes to the 
GtkTreeView?  Do I have to change the XML file or is there way to 
access widgets with code?  As you can tell, this is my first time with 
Glade and libglade so if someone can point me to a web page or a 
project that uses libglade I'd appreciate it.  Maybe I should just have 
glade generate the code so that I can learn, but I keep reading that 
the next version of glade will not have the code generation so I'm 
trying to learn libglade.  I've read everything that comes with glade 
and libglade and Anjuta but I don't find anything beyond how to get a 
libglade file to compile and run.

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

Thanks for any pointers or files/web sites that anyone can direct me to.
-- 
kosh <evil_kosh_uk yahoo co uk>





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