Re: Why these "critical" errors ?



2010/1/19 Glus Xof <gtglus gmail com>:
> But, honestly, I didn't understand why cannot do it... In any case, I
> get it after the Gtk::Main() call.

It's still a problem if the static instance is created before Gtk::Main runs.

> How should I work-around it ?

You can use Meyer's singleton. The static instance will be initialized
the first time it is accessed.

Gtk::Foo &get_static_gtk_foo() {
   static Gtk::Foo foo(1, 2, 3);
   return foo;
}

Regards, Krzysztof Kosiński


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