如何使用wxpython绘制垂直线

sag*_*gar 4 wxpython

我正在尝试下面的代码仍然它给我水平线..我错过了什么?

self.ln = wx.StaticLine(self,-1,wx.Point(620,0),wx.Size(687,7),wx.LI_VERTICAL)

self.ln.SetForegroundColour(wx.Colour(255,0,255))

mr.*_*Shu 7

这段代码适合我

import wx 

class MyFrame(wx.Frame): 
    """ Test of vertical wx.StaticLine """
    def __init__(self, parent=None, id=-1, title=None): 
        wx.Frame.__init__(self, parent, id, title) 
        self.panel = wx.Panel(self, size=(350, 200))

        self.ln = wx.StaticLine(self.panel, -1, style=wx.LI_VERTICAL)
        self.ln.SetSize((30,30))

        print self.ln.IsVertical()

        self.Fit() 

app = wx.PySimpleApp() 
frame1 = MyFrame(title='wx.StaticLine') 
frame1.Center() 
frame1.Show() 
app.MainLoop()
Run Code Online (Sandbox Code Playgroud)