[Glade-users] Problems with signalhandler data.



On Fri, Feb 09, 2001 at 09:37:00AM +1000, Andrae Muys wrote:
Roel Vanhout wrote:
On Thu, Feb 08, 2001 at 09:50:08AM +1000, Andrae Muys wrote:
Hmmm, that probably isn't the best option.  You are aware that libglade
makes it relatively painless to add support for custom widgets at
runtime?  That way all you have to do is edit the .xml file (and I've
almost finished a Glade widget that will let you do that inside Glade).
Hmm... How exactly do I do that? For example, last week I had to remove
the menus that were created in glade, and replace them with hand-made
GnomeUIItems because libglade seems to create menus a bit funny. Anyway,
how would I handle this? How do I define a menu structure without using
the menu editor?
Ah, menus are tricky like that.  They're sort of pseudo-compound
widget's and pseudo-compound containers.  What do you mean by "a bit
funny"?  I haven't had any problems with menus myself.

Yes, tricky indeed :-) What I mean by funny is that I tried to get the
GtkMenuItemFactory that was used to build the menu, but I couldn't find
one. It looks like glade builds all menus with gtk_menu_new and thing,
instead of using GnomeUIItems. Maybe I'm just stupid. Anyway, I managed
to get it to do what I want by making a part of the interface manually,
and that is enough for me. 

As far as normal custom widgets are concerned, take a look at
http://users.bigpond.net.au/mlm/libglade/ which is a tutorial a friend
of mine gave on using libglade.  It includes a decent discussion on how
to add support for custom widgets to libglade, including a real-life
example from an application he's written that needs to do exactly that.
On a related note, while working on this, I really wished there was a
program that will display a tree of widgets of a running gtk program,
you seem to know a lot about gtk/glade, so that's maybe something for a
next project :-)
For the moment, all my OSS work is focused on glade/libglade.  This
would be a seperate application along the lines of editres.  Have you
had a look at GGAD?  IIRC it contains enough information on
GtkObject/GtkWidget to permit someone to write a tool like this.

No I haven't read it, but I think if I spend enough time I could write
it, but I just don't have the time so I was hoping that someone else
would write it :-)
So anyone on the list reading this, if you're bored this weekend, have a
look at it :-)

P.S.  This discussion is probably best moved to the list, as I suspect
other people are likely to be interested in the above as well.

Ok.

cheers,

roel







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