2010/6/11 bulia byak <buliabyak@...400...>:
A question for C++/gtkmm gurus:
Why do we have to have ALL widgets of a dialog declared in an .h file? They aren't usable outside the dialog anyway.
In general, while I appreciate many advantages of C++, the way it is used with gtkmm for Inkscape's dialogs is a major annoyance. A lot more typing in a lot more places than when using simple gtk where you can declare, create, and show a widget in a single spot in code. Is there some grand vision behind this that I'm missing?
It's actually not necessary to declare them in the .h file. Just create them with "Gtk::manage(new Gtk::SomeWidget(...))" and add to a container. Using this method, only the toplevel widget needs to be declared.
I guess someone didn't know how Gtk::manage works and assumed that every widget has to be a member of the dialog's class, so it is destroyed when the the dialog is closed.
Regards, Krzysztof