Re: Menus in GTK--



Tero Pulkkinen wrote:

> >  I want to add/remove entries dynamically to the menu. I have seen code,
> > and seems easy to do, but, how do I change callback and user data
> > associated to a given menu entry? Do I have to remove and insert a new
> > one?
> Yes. remove_entries() and add_entries().

 If menufactory is going to be a high level tool, I think it should have
an easier way of editing menu entries.

> You probably want to put some context structure to the user_data field and
> that would have information needed to access right window.

 This will only work if each menufactory instance keeps its own copy of
the array of entries. I've tried it, and it seems to work, but I'll have
to look at GTK sources to be sure.

> modal dialogs are evil. If you want application modal dialog, you can
> do it with Gtk_Main::grab_add() and calling Gtk_Main::run() and then
> doing Gtk_Main::grab_remove().

 I don't like modal dialogs either. I just wanted to know the "official"
opinion about this ;)

 But now I'm having troubles again. I have several file selection
dialogs. Each one with its own callbacks. Every example I've seen just
creates this dialogs, and then just show/hide them in the right places.
Is this the way it is supossed to work? Doesn't it waste resources?

 Anyway, even if dialogs are done this way, I have to dynamically
create/destroy  several windows. How can I destroy some window to
release its resources? I've tried delete, but I get sissegv. The same
happens with destroy method.

 One final question. Do you have a list of applications being done using
GTK--? If I had more example code to read, I wouldn't have to ask you
every time I'm going to try a new thing :) (I have linuxmp3 source, and
the couple of opengl examples you have in your page).

 Thanks.
 Angel

PS. There is a bug in your 'testme' example. If you close the file
selection, and open it again, you get an empty dialog.



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