GNOME File Selector Developer Documentation | ||
---|---|---|
<<< Previous | Next >>> |
Since this may be many people's first interaction with Bonobo, and since Bonobo's lifetime management may not be apparent at first, this section is here to provide you with the correct way of managing the lifetime of your GNOME File Selector.
The full example in the next section also illustrates the correct behaviour.
Managing the Bonobo::Control part of the GNOME File Selector is easy. When you add the control to its parent window, you pass your reference onto the container (it gets "sunk" in GTK+ terms). This means that you do not need to unref the control, as long as the toplevel window it is in gets destroyed (which you may have to do manually).
The Bonobo::EventSource that was ::queryInterface()'d for needs to be released by you when you are done with it. You also need to remove your Bonobo::Listener from it.
You need to simply unref your BonoboListener.
If you manually obtained the PropertyBag from the file selector control, you need to unref that, too.
Example 11. Unref'ing the Bonobo::PropertyBag
Bonobo_PropertyBag pb; bonobo_object_release_unref (pb, ev); |
![]() | Notice that the pb above is a Bonobo_Unknown (CORBA Object), while the listener is a BonoboObject (GTK+ object). |
<<< Previous | Home | Next >>> |
Easier Property Setting | A Full Example |