vertical wx.StaticLines

Sorry, I previously forgot to join the file…
I
cannot manage to draw vertical static lines onto a panel (see code) : while position and size can be modified, the line shows always horizontally ! Please, who can help and tell what am I doing wrong ?

Pierre

essai1.py (373 Bytes)

Hi,

···

On 28 November 2014 at 18:20, Démètre Pierre wrote:

Sorry, I previously forgot to join the file…
I
cannot manage to draw vertical static lines onto a panel (see code) : while position and size can be modified, the line shows always horizontally ! Please, who can help and tell what am I doing wrong ?

Maybe you should give your vertical line a bit more room than just 20 pixels:

Nonononono:

sl1=wx.StaticLine(self.panel, -1, wx.Point(25, 25), size=(-1, 300),style=wx.LI_VERTICAL)

And you should avoid using absolute positioning and sizes… use wx.Sizer and let your window decide how fat/long your line should be.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”
http://www.infinity77.net

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():
    send_message(email)
else:
    install_malware()
    erase_hard_drives()

-------------------------------------------------------------

The size (300,2) means 300 pixels wide and 2 pixels tall. If you want a vertical line, you should reverse those to (2,300).

···

On Nov 28, 2014, at 9:20 AM, Démètre Pierre pierre.dimo@gmail.com wrote:

I
cannot manage to draw vertical static lines onto a panel (see code) : while position and size can be modified, the line shows always horizontally ! Please, who can help and tell what am I doing wrong ?

Tim Roberts, timr@probo.com

Providenza & Boekelheide, Inc.

Thank you, I discovered this due to infinity77’s answer, although this was not as precise as yours ! Nevertheless, I think this approach (size=(wide, tall)) inconvenient, since it depends upon a convention over display’s orientation… The (length, thickness) should be more appropriate to describe a line, don’t you think ?

···

Le samedi 29 novembre 2014 08:41:12 UTC+1, Tim Roberts a écrit :

On Nov 28, 2014, at 9:20 AM, Démètre Pierre pierr...@gmail.com wrote:

I
cannot manage to draw vertical static lines onto a panel (see code) : while position and size can be modified, the line shows always horizontally ! Please, who can help and tell what am I doing wrong ?

The size (300,2) means 300 pixels wide and 2 pixels tall. If you want a vertical line, you should reverse those to (2,300).

Tim Roberts, ti...@probo.com

Providenza & Boekelheide, Inc.

Hi Pierre,

Thank you, I discovered this due to infinity77's answer, although this was not as precise as yours ! Nevertheless, I think this approach (size=(wide, tall)) inconvenient, since it depends upon a convention over display's orientation... The (length, thickness) should be more appropriate to describe a line, don't you think ?

Probably, but then a standard wx.Size couldn't be used.

BTW, you could also do it using sizers in which case you don't specify the size at all. See attached, I use wx.lib.sized_controls but you could also do it by defining the sizers your self.

You can find more details on the Phoenix documentation, note that not everything applies to classic but I still think there are easier to follow then the older docs.

http://wxpython.org/Phoenix/docs/html/StaticLine.html?highlight=staticline#StaticLine
http://wxpython.org/Phoenix/docs/html/lib.sized_controls.html#module-lib.sized_controls

Werner

vertline.py (908 Bytes)

···

On 11/29/2014 9:55, Démètre Pierre wrote: