[Pythonmac-SIG] Button Label change on EVT_BUTTON in wxpython!!!

Praveen praveen.venkata at gmail.com
Mon Aug 29 03:04:30 CEST 2011


Some system info before proceeding further:

Platform: Mac OS X 10.7.1
Python Version: ActiveState Python 2.7.1
wxPython Version: [url=
http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.2.1-cocoa-py2.7.dmg]wxPython2.9-osx-cocoa-py2.7[/url
]

I want the button label to be changed while performing a task

So, here is what I did/want:

self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install')
self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON)

def OnRun(self,evt):
self.run_button.SetLabel('Installing..')
#call a function that does the installation task
installation_task()
#After task completion, set the button label back to "Install"
self.run_button.SetLabel('Install')

When I try doing this, it doesn't set the label to "Installing" while the
task is being performed. Any suggestions how do I achieve this?

-- 
Have a nice day !!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20110828/2ce6e624/attachment.html>


More information about the Pythonmac-SIG mailing list