On Thu, Sep 30, 2004 at 01:18:04PM +0300, Ruslan wrote:

> I would like to ask people using pygtk + glade to share their approach
> on code decomposition. For example, there is GUI(made in glade) -
> Notebook with different pages containing a lot of widgets that needs to
> be connected with signals handlers. Having one main class that gets all
> widgets from glade file and contains all signal handlers seems not very
> good approach. Probably for each Notebook page should be created
> separate class to handle GUI signals from page widgets, maybe there is
> some kind of software pattern for handling such cases...
> Anyway if someone has any suggestions/ideas, you are welcome.

I put my XML object in a module, essentially making it globally available in
the application, so I can do

  from myxml import XML # XML is a gtk.glade.XML object
  ...
  foowidget = XML.get_widget('foo')
  XML.signal_connect('on_baz_clicked', self.bazmethod)

allowing me to access the widgets and handlers wherever I need them.

Dave Cook

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to