Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12375

Re: Button Label change on EVT_BUTTON in wxpython!!!

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <philip@semanchuk.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.052
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'url:sourceforge': 0.02; 'wxpython': 0.07; 'python': 0.08; 'proceeding': 0.09; 'def': 0.15; '#call': 0.16; 'performed.': 0.16; 'received:mindspring.com': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; 'wrote:': 0.16; 'this?': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'pm,': 0.24; 'changed': 0.24; 'aug': 0.24; 'subject:change': 0.24; 'performing': 0.26; 'suggestion': 0.26; 'function': 0.27; 'installation': 0.30; 'url:downloads': 0.32; 'received:24': 0.32; 'does': 0.32; 'to:addr:python-list': 0.33; 'list.': 0.35; 'charset :us-ascii': 0.36; 'doing': 0.36; 'skip:" 10': 0.36; 'some': 0.38; 'subject:: ': 0.39; 'suggestions': 0.39; 'version:': 0.39; 'header :Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'url:net': 0.60; 'header:Message-Id:1': 0.61; 'back': 0.62; 'here': 0.65; 'luck': 0.68; 'subject:!!!': 0.76; '#1:': 0.84; '#2:': 0.84; '2.7.1': 0.84; '[url=': 0.84; 'received:69.73': 0.84; 'skip:w 60': 0.84
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Apple Message framework v1084)
Subject Re: Button Label change on EVT_BUTTON in wxpython!!!
From Philip Semanchuk <philip@semanchuk.com>
In-Reply-To <aa1212bb-35e5-4bf9-b8ad-7a3c083749c2@x2g2000yql.googlegroups.com>
Date Sun, 28 Aug 2011 22:34:49 -0400
Content-Transfer-Encoding quoted-printable
References <aa1212bb-35e5-4bf9-b8ad-7a3c083749c2@x2g2000yql.googlegroups.com>
To python-list list <python-list@python.org>
X-Mailer Apple Mail (2.1084)
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - deimos.nocdirect.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - semanchuk.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.529.1314585301.27778.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1314585301 news.xs4all.nl 2443 [2001:888:2000:d::a6]:46846
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12375

Show key headers only | View raw


On Aug 28, 2011, at 9:30 PM, Ven wrote:

> 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?


Suggestion #1: After you set the label to "Installing...", try adding self.run_button.Refresh() and/or self.run_button.Update().

Suggestion #2: Ask wxPython questions on the wxPython mailing list.

Good luck
Philip

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Button Label change on EVT_BUTTON in wxpython!!! Ven <praveen.venkata@gmail.com> - 2011-08-28 18:30 -0700
  Re: Button Label change on EVT_BUTTON in wxpython!!! Philip Semanchuk <philip@semanchuk.com> - 2011-08-28 22:34 -0400
  Re: Button Label change on EVT_BUTTON in wxpython!!! Rob Williscroft <rtw@rtw.me.uk> - 2011-08-29 17:46 +0000

csiph-web