tags:

views:

66

answers:

2

In a wxPython application, which i am porting to Mac OSX, I set title of app frame every 500msec in update UI event, and due to that all the panels and windows are refreshed. That seems strange to me and almost halts my application which has many custom drawn controls and screens.

I wanted to know what could be the reason behind it, is it normal for MAC?

Here is a self-constrained script which replicates the scenario using timers. It keeps on printing "on paint" every 500ms because in timer I set title every 500ms.

import wx

app = wx.PySimpleApp()
frame = wx.Frame(None, title="BasePainter Test")
painter = wx.Panel(frame)

def onPaint(event):
    dc = wx.PaintDC(painter)
    print "onPaint"

painter.Bind(wx.EVT_PAINT, onPaint)

def loop():
    frame.SetTitle(frame.GetTitle())
    wx.CallLater(500, loop)
loop()

frame.Show(True)
app.SetTopWindow(frame)
app.MainLoop()

My system details:

>>> sys.version
'2.5 (r25:51918, Sep 19 2006, 08:49:13) \n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]'
>>> wx.VERSION
(2, 8, 10, 1, '')
>>> os.uname()
('Darwin', 'agyeys-mac-mini.local', '9.8.0', 'Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386', 'i386')
A: 

Alas, I'm not sure of the specific issue. However, when you have a sample which demonstrates the problem but are stumped, I've always had great luck by emailing the wxpython-users mailing list and attaching the sample. You should get a response pretty quickly on if there is something you can do to fix it, or if not, that you should file a bug in the tracker.

I have had plenty of problems solved this way, and when I do have to file bugs, they are usually resolved quite speedily. Hope this helps!

mrooney
yes thanks, getting so addicted to SO that i forgot there used to be mailing groups too :)
Anurag Uniyal