And in case you mean derived widgets (e.g. derived from Gtk::Dialog), even those (as classes) don't _need_ to be declared in the .h file, but it's generally better style to do it. However, if you want to get rid of this I don't think anyone anywhere will blame you, they would just have to be moved into the .cc file and merged with their definition.

2010/6/11 Krzysztof Kosiński <tweenk.pl@gmail.com>
2010/6/11 bulia byak <buliabyak@...233.....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

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...1794...s.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel



--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]