Skip to content Skip to sidebar Skip to footer

Rectangle Wont Show Up On Wxpython

The rectangle won't show up for me on a windows computer. I gave this to someone else who was a mac user and the rectangle showed up. I am not receiving any errors so I can't seem

Solution 1:

The problem with this code is that the OP is wanting to draw on the panel, but then proceeds to tell the PaintDC object to paint to the frame. The OnPaint method should look like this:

def OnPaint(self, event):
    dc = wx.PaintDC(self.panel)  # <<< This was changed
    dc.SetPen(wx.Pen('#d4d4d4'))
    dc.SetBrush(wx.Brush('#c56c00'))
    dc.DrawRectangle(10, 15, 90, 60)

Post a Comment for "Rectangle Wont Show Up On Wxpython"