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




On Fri, 25 Sep 1998, Tim Janik wrote:
> 
> that is *not* possible, object data needs a string for the key, neither
> the widget pointer itself nor the page index corresponds to a certain
> string.
> the correct approach is to use gtk_notebook_page_num() to retrive
> the correct index for a widget. the return value for a certain child
> may of course change after you inserted or removed other children.
> 

Yes, this does work; I should have mentioned that I'd found it. It wasn't
in the Gtk-- interface but I added it and am happier. It would be nice to
have the equivalent for GtkMenu (that's so easy to write I might do so
instead of whining. :-) However GtkMenu only uses the index for set_active
and insert; both of those could simply have versions that took a pointer
instead, I think that would be more convenient. 

However, this doesn't solve the reverse mapping problem; created, for
example, by gtk_notebook_current_page(), which returns an index. This is
so easy to solve I already sent in a several-line patch. ;-)

Havoc






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