I am using wx.Timer to update a clock on a wxPython display. The relevant lines of code look like this:
timer = wx.Timer(self, -1)
self.Bind(wx.EVT_TIMER, self.onTick, timer)
timer.Start(milliseconds=1000, oneShot=False)
where self.onTick(self.event) handles the event every second by printing "TICK".
This works on WindowsXP but not on MacOSX. On MacOSX, onTick() never gets called at all.
What am I doing wrong??
6 13148
I am using wx.Timer to update a clock on a wxPython display. The relevant lines of code look like this:
timer = wx.Timer(self, -1)
self.Bind(wx.EVT_TIMER, self.onTick, timer)
timer.Start(milliseconds=1000, oneShot=False)
where self.onTick(self.event) handles the event every second by printing "TICK".
This works on WindowsXP but not on MacOSX. On MacOSX, onTick() never gets called at all.
What am I doing wrong??
This should have been posted in the python forum not the cafe. Make sure to post in the correct forum.
I am using wx.Timer to update a clock on a wxPython display. The relevant lines of code look like this: -
timer = wx.Timer(self, -1)
-
self.Bind(wx.EVT_TIMER, self.onTick, timer)
-
timer.Start(milliseconds=1000, oneShot=False)
-
where self.onTick(self.event) handles the event every second by printing "TICK".
This works on WindowsXP but not on MacOSX. On MacOSX, onTick() never gets called at all.
What am I doing wrong??
-- wxNewbie
This should have been posted in the python forum not the cafe. Make sure to post in the correct forum.
Which explains the double post, so I wont berate the OP for such action. Thank ILP.
I am using wx.Timer to update a clock on a wxPython display. The relevant lines of code look like this: -
timer = wx.Timer(self, -1)
-
self.Bind(wx.EVT_TIMER, self.onTick, timer)
-
timer.Start(milliseconds=1000, oneShot=False)
-
where self.onTick(self.event) handles the event every second by printing "TICK".
This works on WindowsXP but not on MacOSX. On MacOSX, onTick() never gets called at all.
What am I doing wrong??
-- wxNewbie
As for you, sbernste, we'll teach you about [ code ] tags as we go along.
Timers are a bit of a mystery. I've never been able to find anyone who could tell by why a 50mS wxTimer should only run 16 times a second on one machine out of 4 that I tried my code on. The wxTimers are completely OS dependant, so I guess the only question that I have for you is "What's your wxPython version on the Mac?".
As for you, sbernste, we'll teach you about [ code ] tags as we go along.
Timers are a bit of a mystery. I've never been able to find anyone who could tell by why a 50mS wxTimer should only run 16 times a second on one machine out of 4 that I tried my code on. The wxTimers are completely OS dependant, so I guess the only question that I have for you is "What's your wxPython version on the Mac?".
(1) What are code tags?
(2) I am running wxPython version 2.8.4.0 (mac-ansi) under MacOsX darwin.
(3) I have implemented a work-around by running a loop in a separate thread that calls time.sleep(1) and fires off a custom wxPython event. But I'd still rather use wxTimer if at all possible.
(1) What are code tags?
It's all right there, on the right hand side of the page when POSTING or REPLYing: 4 little things to keep in mind in * GUIDELINES...
(2) I am running wxPython version 2.8.4.0 (mac-ansi) under MacOsX darwin.
I just got a Mac (kind of old, but it was free - OS X 10.1.5). I may have to start playing with it soon. I'm on a HUGE project at the moment.
(3) I have implemented a work-around by running a loop in a separate thread that calls time.sleep(1) and fires off a custom wxPython event. But I'd still rather use wxTimer if at all possible.
Nice work-around...
I remember reading that if the system is short on timer resources, the wxTimer objects would not run. Perhaps that's the case here. Or perhaps there's a compatability issue with that OS. It's always worth trying the latest version.
Good luck...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: SeeBelow |
last post by:
Do many people think that wxPython should replace Tkinter? Is this
likely to happen?
I ask because I have just started learning Tkinter, and I wonder if I
should abandon it in favor of...
|
by: Laughlin, Joseph V |
last post by:
If I want a function to be called every second, how would I do this?
Would I use timer events?
Joe Laughlin
Phantom Works - Integrated Technology Development Labs
The Boeing Company
|
by: Qiangning Hong |
last post by:
I asked this question on comp.python.wxpython using the subject "a
wx.Timer like timer without wx package?" and David Fraser there
suggested me to ask here for a more general solution.
I am...
|
by: timothy.williams |
last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2
machine.
I have python in a non-standard place, but I'm using --prefix with the
configure script to point to where I have...
|
by: janama |
last post by:
Hi all,
Using wx
When adding a second timer as i have the first, the second timer
adding stops the first timer (updating or stops?) . In this example im
updating a uptime and localtime label....
|
by: John Salerno |
last post by:
I'd be curious to know if this works any differently on other
computers/platforms or while other things are happening in the
background. I can't tell if it's the Timer object that isn't keep...
|
by: hg |
last post by:
Hi,
I read that logging was thread safe ... but can I use it under a GUI timer ?
Thanks,
hg
|
by: John Dann |
last post by:
I need what I'd call (in .Net) a timer, ie I need to run a function eg
every 2 seconds - it doesn't need to be millisec accurate but it would
be nice if it wasn't eg every 4 seconds or something.
...
|
by: 5lvqbwl02 |
last post by:
Windows XP SP3
Python 2.5
wx.version() = '2.8.1.1 (msw-unicode)'
------
I have written the following *simplest* implementation of wx.timer I
can think of. No workie. I want an exception, a...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |