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


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));

    // NOTE: now extracts the C object
    gtk_container_add(GTK_CONTAINER(panel_applet), GTK_WIDGET(applet->gobj()));
    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

Ole Laursen

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