Re: Parent of a widget



Quoth Jim Edwards:
> Joel Uckelman wrote:
> 
> > Quoth "Michael":
> > >
> > > Im still having problem with this
> > >
> > > I have a GtkCList* and I want to find the GtkWidget* of the window that
> > > the listbox is in.
> > >
> > > Any options ? gtk_window_get_parent will not work.
> >
> > You could use gtk_object_set_data to embed in the CList a pointer to its
> > parent window, which you can then retrieve from the CList later using
> > gtk_object_get_data. I don't know if this is the best way to do it, but it
> > works for me.
> >
> 
> shouldn´t gtk_widget_get_toplevel work?
> 
> Jim

Hmmm, I think so, but I should qualify slightly what I said above: what I'm 
actually using the gtk_object_(get|set)_data calls for is a situation in 
which the parent of a widget isn't a top-level window.

To the originator of this thread: is the function you're referring to 
gtk_widget_get_parent_window instead of gtk_window_get_parent? If not, you 
should give the former a try.

-- 
J.






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