referring to children of a container
- From: Havoc Pennington <rhpennin midway uchicago edu>
- To: gtk-list redhat com
- Subject: referring to children of a container
- Date: Sun, 20 Sep 1998 17:36:05 -0500 (CDT)
Hi,
I am writing various dynamic notebooks and menus. For example, the user
might be able to click a button and remove a notebook page, or a menu
might change as the available options change.
The current GtkNotebook and GtkMenu API's seem to be very unwieldy for
this purpose. The basic problem is that pages/menuitems are inserted as
pointers, but subsequently have to be referred to by index. If you build
these things with a series of appends, it's quite clear what the index of
a given item is; but if you build the widget, then remove from the middle,
insert in the middle, etc. in an unpredictable way, it's very difficult to
know what the index of any particular item is.
As far as I can see there are no functions to query index; it would help
to have a function to get notebook pagenumber from a child's GtkWidget*
for example. That would be pretty easy. Also, GtkCList (which is designed
with dynamic changes in mind, I guess) returns the index of the
newly-added row from the append/etc. function, and has find_by_data
functions. How would people feel about adding these to more widgets?
Any suggestions in general? Say for example a GtkMenu has been created and
then changed in arbitrary ways. I now want to set_active a particular item
(I know the name of the item and its callback, maybe its GtkWidget*, but
not the index).
Thanks,
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]