Re: Gtk::ListStore problem



Paul Davis napisał(a):
you cannot construct any gtkmm (or glibmm, or pangomm or gdkmm etc etc)
types until the type system for each namespace has been set up, which is
normally done as part of Gtk::Main::init() or explicitly in main().

Ok, so how can I explicitly set this type system?
Or maybe I try Gtk::TreeView::get_model() method to get the model (set up in main() ) by any function which needs it? Like this way:

Gtk::TreeView m_TreeView;
Glib::RefPtr<Gtk::ListStore> m_refTreeModel;

int main() {
  m_refTreeModel = Gtk::ListStore::create(m_Columns);
  m_TreeView.set_model(m_refTreeModel);
}

int f1() {
  Glib::RefPtr<TreeModel> m_refTreeModel = m_TreeView.get_model();
  ...
}

int fn() {
  Glib::RefPtr<TreeModel> m_refTreeModel = m_TreeView.get_model();
  ...
}

Do you have a better idea?

Regards
Tomek




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