Is PENSTYLE_LONG_DASH supported?

8 views
Skip to first unread message

ABC

unread,
Apr 29, 2020, 9:30:05 PM4/29/20
to wxPython-dev
I don't see any difference between short_dash and long_dash.

ABC

unread,
Jun 4, 2020, 9:05:36 PM6/4/20
to wxPython-dev
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(
Reply all
Reply to author
Forward
0 new messages