[gtkmm] Custom store class
- From: Tim Flechtner <timf trdlnk com>
- To: "'gtkmm-list gnome org'" <gtkmm-list gnome org>
- Subject: [gtkmm] Custom store class
- Date: Fri, 21 Feb 2003 16:38:40 -0600
hello,
i'm trying to write my own store class for use with a TreeView, and
am getting tripped up (i think) on the glib object system.
i've defined a class:
class Store_c : public TreeModel, public Glib::Object
{
public:
Store_c();
~Store_c();
private:
};
with a ctor implementation of:
Store_c::Store_c()
: TreeModel(), Glib::Object()
{
}
in my main.C, i do this:
main(int argc, char** argv)
{
Gtk::Main kit(argc, argv);
View_c view;
ColumnRecord_c column_record;
Glib::RefPtr<Store_c> store_gptr(new Store_c());
view.set_model(store_gptr);
view.append_column("Column Title", column_record.m_column);
Window window;
window.add(view);
window.show_all();
kit.run(window);
return 0;
}
it builds, but when i run the resulting binary i get:
(store:28951): glibmm-CRITICAL **: file interface.cc: line 53
(Glib::Interface::Interface(const Glib::Interface_Class &)): assertion
`gobject_ != 0' failed
(store:28951): glibmm-WARNING **: Object::Object(): Did you really mean
to call this?
(store:28951): Gtk-CRITICAL **: file gtktreemodel.c: line 697
(gtk_tree_model_get_n_columns): assertion `GTK_IS_TREE_MODEL
(tree_model)' failed
(store:28951): GLib-GObject-WARNING **:
gsignal.c:1893:g_signal_connect_data(): signal `row_changed' is invalid
for instance `80c5280'
(store:28951): GLib-GObject-WARNING **:
gsignal.c:1893:g_signal_connect_data(): signal `row_inserted' is invalid
for instance `80c5280'
(store:28951): GLib-GObject-WARNING **:
gsignal.c:1893:g_signal_connect_data(): signal `row_has_child_toggled'
is invalid for instance `80c5280'
(store:28951): GLib-GObject-WARNING **:
gsignal.c:1893:g_signal_connect_data(): signal `row_deleted' is invalid
for instance `80c5280'
(store:28951): GLib-GObject-WARNING **:
gsignal.c:1893:g_signal_connect_data(): signal `rows_reordered' is
invalid for instance `80c5280'
(store:28951): Gtk-CRITICAL **: file gtktreemodel.c: line 738
(gtk_tree_model_get_iter): assertion `GTK_IS_TREE_MODEL (tree_model)' failed
the signal warnings make sense to me, since i haven't built out Store_c
to provide the necessary interfaces/signals yet, but the failed
GTK_IS_TREE_MODEL and gobject_ != NULL assertions lead me to believe
i've already missed a key step. can anyone point out relevant
documentation, or explain what i'm gdoing wrong? i've been looking at
the code for ListStore, but i think there is enough difference between
ListStore, which wraps an existing gtk (not mm) widget and what i'm
doing (no gtk widget, just a c++ class) that i can't just emulate what i
found there.
thanks!
-tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]