Re: [gtk-list] Re: gtk_notebook_remove_page




Sascha Ziemann <szi@aibon.ping.de> writes:

> > When a widget's parent is destroyed, gtk_object_unref will be called
> > on the widget. Since a widget is created with a reference count of 1,
> > unless you have explicitely called gtk_object_ref on the widget, it
> > will be destroyed. (The counting here is a bit strange, but it is
> > meant, I suppose, to let people not worry about reference counting in
> > the normal case.)
> 
> Does this mean that I can use the same widget in different places. For
> example the same entry-field in every page or a notebook?

Unfortunately, no. A widget can only have one parent. The reference
counting is used in situations where an object (or application) stores
a reference to another object. For instance, a Text widget calls 
gtk_object_ref on the [HV]Adjustments that it uses to communicate with
its scrollbars. 

Generally, if you are using something other than C, the language
binding should take care of these details for you.

Regards,
                                                 Owen



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