[wxPython] wxSplitter position setting appears ineffectual

Hi,

I ran into this problem before. I believe the problem stems from the
fact that you seem to be trying to set the position before the window
knows how big it is. The negative number specifies the windowsize -
x. If the window hasn't been shown (or at least sized) yet it doesn't
know what the windowsize is to make the calculation. Or I think the
default is 20,20.

I'm not sure at what point you can set the sash position but I know
that after the window shows itself definitely works. I looked for
something similar to the frame.pack() function in java so I could size
the window before showing it but I don't think I found it.

Hope that helps,
Mike

···

--__--__--

Message: 14
From: "Mike C. Fletcher" <mcfletch@home.com>
To: "wxPython Users \(E-mail\)" <wxpython-users@lists.wxwindows.org>
Date: Fri, 27 Apr 2001 04:54:31 -0400
Subject: [wxPython] wxSplitter position setting appears ineffectual
Reply-To: wxpython-users@lists.wxwindows.org

In the code below, I attempt to build a nested splitter structure with the
splitters initialised to certain widths. Using negative values (as
described in the docs) doesn't seem to work for either splitter.

For the inner splitter, SetSashPosition updates the value retrieved by
GetSashPosition, but doesn't seem to change the width of the splitter.
Nothing I've tried seems able to change this position.

Thoughts appreciated,
Mike

hi,

I'm sorry . I can't writing english very well but i can understand english .

When Main frame is splitted, the Sash position is moving by mouse's click and drag.

I want fix sash position.

can anyone help?

Hello Kang,

Saturday, April 28, 2001, 4:59:27 AM, you wrote:

hi,

I'm sorry . I can't writing english very well but i can understand english .

When Main frame is splitted, the Sash position is moving by mouse's click and drag.

I want fix sash position.

can anyone help?

You can hook mouse events and ignore them /without event.Skip()/.

···

--
regards,
Niki Spahiev

When Main frame is splitted, the Sash position is moving by mouse's click

and drag.

I want fix sash position.

can anyone help?

Create an event handler on the splitter window for
EVT_SPLITTER_SASH_POS_CHANGED like this:

    def OnSashChanged(self, evt):
        evt.SetSashPosition(-1)

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!