wxPython and Tkinter

W

whatazor

Hi all,
I migrate some code from tkinter to wxpython. I need the equivalent
Tkinter method Tkinter.Tk.after
in wxPython, but I'm not able to find it. It exist or there are other
trick to emulate it?

thank you
w
 
W

whatazor

Hi all,
I migrate some code from tkinter to wxpython. I need the equivalent
Tkinter method Tkinter.Tk.after
in wxPython, but I'm not able to find it. It exist or there are other
trick to emulate it?

thank you
w

"after" in Tk method allows to all a function every X milliseconds.
 
I

imbunche

"after" in Tk method allows to all a function every X milliseconds.

I think you need to setup an wx.Timer object.
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)

where the self.OnTimer is the method you want to call.
You need to start the timer:
self.timer.Start()

That's it, I think.
 
K

kyosohma

I think you need to setup an wx.Timer object.
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)

where the self.OnTimer is the method you want to call.
You need to start the timer:
self.timer.Start()

That's it, I think.

That should definitely work. For documentation, see the following
links:

http://wiki.wxpython.org/Timer
http://www.wxpython.org/docs/api/wx.Timer-class.html
http://www.onlamp.com/pub/a/python/excerpts/chpt20/wxpython.html?page=3

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top