ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] problem simulating button press
by Steven Sproat other posts by this author
May 28 2009 11:25PM messages near this date
Re: [wxpython-users] problem simulating button press | [wxpython-users] Toasterbox patch
Alec Bennett wrote:
>  I'm trying to simulate a button press in my application. All I'm concerned about is making
 the button go to its hit state, and then back to normal. I guess I could do this with a tim
er but wondering if there's a more graceful way.
> 
>  Here's the code I'm using so far:
> 
>  self.button1 = wx.Button(self.panel, -1, pos=(0, 0), label="Camera 1")
> 
>  click_event = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, self.button1.GetId())
> 
>  self.button1.Command(event)
> 
>  This triggers the event bound to button1, but doesn't make the button appear pressed and t
hen released. Am I stuck with a timer to achieve this visual effect?
> 
>  Thanks.
> 
> 
> 
> 
> 
> 
>        
>  _______________________________________________
>  wxpython-users mailing list
>  wxpython-users@[...].org
>  http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
> 
>    
Try wx.PostEvent

PostEvent(dest,
          event)
  

Send an event to a window or other wx.EvtHandler to be processed
later



_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Alec Bennett
Robin Dunn
Steven Sproat

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved