Gtk::ListStore problem



Hi!
Why can't I create Gtk::ListStore model in the global space? (at the
beginning of my file, outside the main() function).

I've derived and defined a class:
class TreeViewTaskListColumnRecord : public Gtk::TreeModel::ColumnRecord
{...}

and try to do it that way:

23: TreeViewTaskListColumnRecord tasklist_columns;
24: Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
25: m_refTreeModel = Gtk::ListStore::create(tasklist_columns);

What I get is an error in line 25:
"error: expected constructor, destructor, or type conversion before '='
token".

If I put those 3 lines into the main() function, then everything is
perfect. Why?

Regards
Tomek



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