sagar
sagar

Reputation: 1435

How to draw vertical line using wxpython

i am trying below code still it is giving me horizontal line..i am missing something?

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))

Upvotes: 4

Views: 6844

Answers (2)

sagar
sagar

Reputation: 1435

thanks for ur reply got it now..i was missing style keyword ..earliar it has not given error thats why didnot found it

self.ln = wx.StaticLine(self, -1, size=(4,479),style=wx.LI_VERTICAL)

Upvotes: 0

mr.Shu
mr.Shu

Reputation: 478

This code works for me

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()

Upvotes: 7

Related Questions