[Tutor] how to link GUI app to the code

Alan Gauld alan.gauld at btinternet.com
Tue Dec 6 10:18:01 CET 2011


On 06/12/11 04:30, surya k wrote:
> I have designed a application using WxGlade but I don't know how to link
> it to my code and run it.

Glade generates wxPython code.

In wxPython we bind methods to widgets using the Bind() method.

Here is an example:

self.Bind(wx.EVT_BUTTON, self.OnSubmit, self.button_submit)

Where:
EVT_BUTTON is a standard event time defined in wxPython.
self.OnSubmit is your event handler method
self.button_submit is your submit button widget

It would be useful for you to go through the wxPython tutorials.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list