Here's the code. Please confirm.
import wx
class DrawPanel(wx.Frame):
def __init__(self, height_, width_):
wx.Frame.__init__(self, None, title="Draw on Panel")
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.height = height_
self.width = width_
def draw(self, dc_):
# lines
dc_.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_SHORT_DASH))
dc_.DrawLine(0, 150, self.width-1, 150)
dc_.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_LONG_DASH))
dc_.DrawLine(0, 200, self.width-1, 200)
# end draw
def OnPaint(self, event=None):
dc = wx.PaintDC(self)
dc.Clear()
self.draw(dc)
# end OnPaint
# main
app = wx.App(False)
frame_h = 250
frame_w = 200
frame = DrawPanel(frame_h, frame_w)
frame.SetClientSize((frame.width, frame.height)) # sets the size of the INSIDE of a window
frame.Show()
app.MainLoop(