Hi Anurag,
On Mar 5, 2010, at 8:23 AM, anuraguni...@yahoo.com wrote:
> this is just a self contained example to show the problem.
> In real case, i only update title periodically on UPDATE_UI event e.g.
> when user modifies document I set title with '*'
> so I have workarounds but the question here is
> is this a bug? or some deep reason behind it which I fail to
> understand
It's a bug. Since the API for changing a control's label and a Frame's title are the same on Mac (for Carbon at least), the Frame code just calls wx.Window.SetLabel. SetLabel, though, calls Refresh() on the control, which makes sense for a wx.Window but is probably not necessary or useful for a Frame.
However, I'm surprised a Refresh() would grind your application to a halt. Are you using wx.BufferedPaintDC or doing drawing during a repaint using wx.ClientDC?
Regards,
Kevin
> On Mar 5, 8:51 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
>> On Mar 5, 2:23 am, anurag uniyal <anuraguni...@yahoo.com> wrote:
>>> 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( bug?)
>>> 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')
>>> rgds
>>> Anurag
>>> Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!Yahooist Teil der Yahoo Markenfamilie
>> 1) Why are you setting the title of the frame repeatedly to the same
>> title?
>> 2) Even if there is a valid reason (which I doubt), updating it faster
>> than the eye can see is not a good idea
>> -------------------
>> Mike Driscoll
>> Blog: http://blog.pythonlibrary.org
> --
> To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
> or visithttp://groups.google.com/group/wxPython-users?hl=en