[gtkmm] Custom TreeStore Problems



I am trying to implement a Custom TreeStore using GtkMM. Unable to find any documentation on how to do this, I figured I would just give it a shot and see if I could figure it out. But I have now come to a point where I am stumped. I'm not sure if I'm just missing something, or if it is a bug.

Seeing as there is no example for creating a custom tree store in the GtkMM tarball, I wrote a small program that (if it worked) would demonstrate how to do this. After if is fixed and working, it might be helpful if it were included into the tarball (or perhaps elsewhere) for others to examine.

Right now, I'm getting the following runtime errors:

(customtreestore:343): glibmm-CRITICAL **: file interface.cc: line 53 (Glib::Interface::Interface(const Glib::Interface_Class&)): assertion `gobject_ != 0' failed

(customtreestore:343): glibmm-CRITICAL **: file interface.cc: line 53 (Glib::Interface::Interface(const Glib::Interface_Class&)): assertion `gobject_ != 0' failed

(customtreestore:343): glibmm-CRITICAL **: file interface.cc: line 53 (Glib::Interface::Interface(const Glib::Interface_Class&)): assertion `gobject_ != 0' failed

(customtreestore:343): glibmm-CRITICAL **: file interface.cc: line 53 (Glib::Interface::Interface(const Glib::Interface_Class&)): assertion `gobject_ != 0' failed

(customtreestore:343): GLib-GObject-CRITICAL **: file gobject.c: line 1319 (g_object_ref): assertion `G_IS_OBJECT (object)' failed

(customtreestore:343): GLib-GObject-CRITICAL **: file gobject.c: line 1337 (g_object_unref): assertion `G_IS_OBJECT (object)' failed

(customtreestore:343): GLib-GObject-CRITICAL **: file gobject.c: line 1337 (g_object_unref): assertion `G_IS_OBJECT (object)' failed

Oddly enough, several of these errors appear when I am copying the Glib::RefPtr<> for the CustomTreeStore! I find this to be most bizzare. NONE of the virtual functions are being called, and I don't know why. Is it possible that I'm not using the Glib::RefPtr<> correctly?

I saw that someone earlier mentioned having similar problems and Murray suggested the following:
I suspect that a custom Store might require similar techniques as a custom CellRenderer, because it might require the definition of a new GObject type at runtime. You should probably look at the constructors in the custom cellrenderer example.

I just wanted to say that I am doing this, and the program still yields the results shown above.

The source code to this example can be found here:
ftp://ftp.voria.net/pub/customtreestore.tar.gz (Or if you prefer http, use http://ftp.voria.net/pub/customtreestore.tar.gz )

Thanks in advance!

--- darco
http://www.deepdarc.com/

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