6 void initialize_quark()
10 //g_warning("initializing quark.");
11 quark_test = g_quark_from_static_string("quarktestmurrayc");
15 void on_object_qdata_destroyed(gpointer data)
17 //This doesn't seem to be called:
18 g_warning("on_object_qdata_destroyed(): c instance=%p", (void*)data);
21 int main(int argc, char**argv)
23 Gtk::Main app(&argc, &argv);
25 Gtk::Dialog* pDialog = new Gtk::Dialog();
26 Gtk::VBox* pBox = pDialog->get_vbox();
28 //Set a quark and a callback:
30 int a = 0; // (This doesn't work unless we have a non-null value for the 3rd parameter.)
31 g_object_set_qdata_full((GObject*)pBox->gobj(), quark_test, &a, &on_object_qdata_destroyed);
33 g_warning("vbox refcount=%d", G_OBJECT(pBox->gobj())->ref_count);
37 g_warning("after delete");