[wingide-users] Interference between debugger and wxPython on MacOS

Luc Bourhis luc_j_bourhis at mac.com
Sun Feb 17 07:30:58 MST 2008


I have run into a strange problem while debugging wxPython programs on  
MacOS.

Here is a self-contained script to reproduce the problem.

from __future__ import division
#import wingdbstub # if this line is not commented out, the bug appears
import wx

class MyWindow(wx.Window):

   def __init__(self, parent):
     wx.Window.__init__(self, parent, size=(-1, 50))
     self.Bind(wx.EVT_PAINT, self.OnPaint)

   def OnPaint(self, event):
     w,h = self.Size
     dc = wx.PaintDC(self)
     for i in xrange(h):
       u = i/h
       c = (u*100 + (1-u)*200,)*3
       dc.SetPen(wx.Pen(wx.Colour(*c)))
       dc.DrawLine(0, i, w, i)


a = wx.App()
w = wx.Frame(None)
s = wx.BoxSizer(wx.VERTICAL)
w.SetSizer(s)
p1 = MyWindow(w)
s.Add(p1, flag=wx.EXPAND)
p2 = MyWindow(w)
s.Add(p2, flag=wx.EXPAND)
q = wx.StaticText(w, label="The controls above are custom-filled")
s.Add(q)
s.SetSizeHints(w)
w.Show()
a.MainLoop()

This script should open a window with 3 panes stacked up vertically:  
the top two are filled with a gradient of grey while the bottom one is  
just a static text.

If the script is run as it is, it works. But if it is launched with  
the debugger, or if it is run without commenting out the line "import  
wingdbstub", then only the top pane is correctly painted. The next one  
down is not painted with the gradient and the static text at the  
bottom is not either. Worth, the buttons in the window title bar are  
not painted either.

I am running WingIDE 3.0.3-1 on MacOS 10.5.2 with wxPython 2.8.7.1  
(mac-unicode).

Any help will be greatly appreciated.

Luc Bourhis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : /pipermail/wingide-users/attachments/20080217/049cb551/smime.bin


More information about the wingide-users mailing list