On Jun 11, 2010, at 3:40 PM, Milosz Derezynski wrote:
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.
Well, it can be done but then it really needs to be done with care.
That is, some things (such as packing widgets) can be best left to Gtk::manage() in the base class ctor, but many others (such as checkboxes, edit areas, etc) are best left as members in at least some class.
I've been doing various cleanups of this sort for some time now, and it's not quite as simple as some might think. But I agree that it's good to keep the .h files to only what they really need to have, and hide everything else in the .cpp files.