[Tutor] Question about structuring my pygtk program

Tino Dai tinoloc at gmail.com
Tue Jan 23 17:48:53 CET 2007


Hi Everybody,

       I have a question about structuring first pygtk program now that I
have the basics working, I am moving to the next step of organizing my
program so it doesn't turn into spaghetti code. Right now, what I'm doing is
if a component of the GUI is used in more than one spot, I make that into a
separate little function returning a GUI fragment that I can call several
times throughout the program. I have been doing this type of "non-redundant
code" in a non-GUI environment for many years, and it's worked well. Also, I
read about this technique from the Pragmatic Programmer - having one section
of code that does a specific task - instead of having it in multiple
locations. Does this translate to the GUI environment? If so, is there an
easy of accessing the different input boxes easily? If you need a code
exxample, just ask.

Thanks,
-Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070123/f159ea51/attachment.html 


More information about the Tutor mailing list