Re: [gtkmm] Mixing of GTK and Gtk::manage safe?



On Wed, 2003-01-29 at 23:21, Ole Laursen wrote:
> Hi,
> 
> I'm in the process of writing a panel applet. Since there is no
> wrapper for PanelApplets yet, I'm using the awkward C interface (I had
> a brief look at bonobomm, but I can't compile it). So the
> question is, is the following safe:
> 
>   gboolean hardware_monitor_factory(PanelApplet *panel_applet,
>                                     const gchar *iid,
>                                     void *)
>   {
>     // NOTE: uses manage to control lifetime
>     Applet *applet = manage(new Applet(panel_applet));
>     applet->show();
> 
>     // NOTE: now extracts the C object
>     gtk_container_add(GTK_CONTAINER(panel_applet), GTK_WIDGET(applet->gobj()));
>     gtk_widget_show(GTK_WIDGET(panel_applet));
>   
>     return true;
>   }
> 
> Applet derives from Gtk::Frame. Will my Applet-object be deleted when
> the panel_applet is destructed, just as if it were in the realm of
> *mm?

Yes. It should.

-- 
Murray Cumming
murray usa net
www.murrayc.com




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