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



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?

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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