Re: Gtk::ListStore problem
- From: "R. Douglas Barbieri" <dooglio gmail com>
- To: gtkmm-list gnome org
- Subject: Re: Gtk::ListStore problem
- Date: Wed, 30 Nov 2005 10:11:19 -0800
Why not just create a singleton class? Then when you actually access
the instance, it will create itself after the type system is
initialized.
Why do you need to have the model and tree global, anyway?
On 11/25/05, Tomek <morales inet24 pl> wrote:
> 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
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
--
R. Douglas Barbieri
doug dooglio net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]