Re: [gtk-list] referring to children of a container

>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).

  An easy way to deal with this might be to just put the information into
the parent widget with gtk_set_data.  You could use the address as the key
(perhaps using sprintf to make things easier), and then store the index as
the data.  Or perhaps just use the name as the key, and then the index
number as the data.  All sorts of useful combinations are possible.

  Glade does things similar to this, and it seems to me a very clever way of
dealing with these types of problems.

  But I would agree that direct support for doing things like this without
having to get and set data would be nice.


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