Click to See Complete Forum and Search --> : glade-- gtkmm question
niales
01-19-2004, 02:49 PM
This one has been really bugging me.
I'm using
glade 2.0
glade-- 2.0.0.1
c++ (g++ 3.3.2)
Oh yeah, if you haven't used glade with c++ this probably won't make any sense.
I create two windows, a main window and one 'about' window. I want to have a button that will close the 'about' window. But all the widgets are local variables to a glade file that I'm not supposed to edit.
calling gtk_main_quit() will close everything, that's not what I want, and I can't do a gtk_widget_destroy(this), because'this' is const. Any idea's?
-niales
bwkaz
01-19-2004, 07:50 PM
lookup_widget()?
Works in normal glade, with just plain Gtk+, using the C language binding, at least... Take a look in support.c (or whatever glade-- calls it) to see if it's defined.
Normal glade has the same problem, BTW -- all the widget variables are local to a single function (in interface.c), so none of the other code can get at the widgets without lookup_widget().
niales
01-24-2004, 02:16 AM
there is no lookup_widget() in glade--, the problem turned out to be visibility. It seems selecting with the scroll wheel won't stick. Everything I set public or protected was reverting to private.
Working with glade was been one problem after another, my next question is if you've heard of any extensive/advanced glade-- tutorials. They would probably help.
-niales
bwkaz
01-24-2004, 09:56 AM
No, not really. Never had a reason to look before, since normal Gtk+ works well enough for me. ;)
micio
01-29-2004, 09:58 AM
this is the main problem I encountered using glade only, you cannot modify source files since are generated.
How about using glade to generate UI, then libglade? in this way you "load" the gui and then (putting visibility to "No" in glade) modify it, add/remove callbacks and so on ... try it, libglade has 5 or 6 pages of manuals, so it is very simple to use.
micio
bwkaz
01-29-2004, 08:00 PM
Originally posted by micio
you cannot modify source files since are generated. Huh? Yes you can -- you can make any changes you want to make to main.c, since it only ever gets created once. You can make any changes you want to callbacks.c, since it only ever gets added to.
support.c is only for functions like lookup_widget, so you shouldn't have to change it.
The only other file it generates is interface.c. That's the one that sets up your widgets. What do you need to change in there that you can't change in Glade itself?
You can hook up signals in Glade, too. That's what the "Signals" tab is for in the widget properties window.
Well, this is Glade 2. If you're still using Glade 1, though, then it might have other issues (since it's only using gtk+ 1...).