On Wed, 2010-09-08 at 17:46 -0700, Andrew Poelstra wrote: > Well, I am converting the top-level window to its own widget, rather than > using a stock GtkWindow and tacking stuff onto it. That way I can migrate > a lot of the global variables to member variables, pass more things as > parameters, and use the 'const' keyword a lot more.
I'm not sure I see the point of making the whole top-level window a dedicated widget per-se, although the goal to encapsulate various state variables sounds excellent. I was never really sure what point to start sub-classing to make a new widget. My acid test was usually whether that widget had useful self-contained functionality which could be re-used in other places. For example, I've got a moderately large refactor queued which removes most of the drawing back-end specific code from the GTK hid, splitting all the GDK specific rendering details into a separate file. With GL enabled, it removes that file from the build and swaps in an equivalent which uses OpenGL. All render-specific member variables are defined locally to those files, avoiding the GDK/GL choice cluttering up more global structures. When devising this split, I was very tempted to turn the PCB drawing area into its own widget, and teach that to draw (and potentially have two implementations / sub-classes), but so far I didn't take that route. There is code in PCB which depends GDK / GL rendering, but does not renders not to a widget, rather to a GdkPixbuf. I think making the whole main window a dedicated widget is perhaps a step to far (or too early). There are probably other more useful refactors, such as making a layer-selector widget, route-style selector widget etc., and defining clean interfaces with those. Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me) _______________________________________________ geda-user mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

