SetSashPosition

Hi. I'm using a SplitterWindow, and I'm trying to get the window proportions to stay constant when the window is resized. My OnSize works when I drag a corner of the window around, but not when I maximize the window. Anyone know what I'm doing wrong? Thanks. (Linux, GTK, wxPython 2.4.1.2)

    def OnSize(self, event):
      event.Skip()
        w = event.GetSize().GetWidth()
        self.splitter.SetSashPosition(int(float(w)*self.sashProportion), True)

Hi,

A few days a ago I was looking to this exact thing. I
found
http://wiki.wxpython.org/index.cgi/ProportionalSplitterWindow
from which I inspired myself and it works ok -
including maximizing. I tested it on win2k only so I'm
not sure if it behaves on GTK the same.

Sorin

Hi. I'm using a SplitterWindow, and I'm trying to
get the window proportions to stay constant when the
window is resized. My OnSize works when I drag a
corner of the window around, but not when I maximize
the window. Anyone know what I'm doing wrong?
Thanks. (Linux, GTK, wxPython 2.4.1.2)

    def OnSize(self, event):
      event.Skip()
        w = event.GetSize().GetWidth()

self.splitter.SetSashPosition(int(float(w)*self.sashProportion),

···

--- Scott <syrinx@simplecom.net> wrote:

True)
     

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

To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861

Thanks, I'll take a look in the morning. Appreciate it!

···

On Tue, 11 May 2004 23:50:46 -0700 (PDT) "Sorin C." <soso_pub@yahoo.com> wrote:

Hi,

A few days a ago I was looking to this exact thing. I
found
http://wiki.wxpython.org/index.cgi/ProportionalSplitterWindow
from which I inspired myself and it works ok -
including maximizing. I tested it on win2k only so I'm
not sure if it behaves on GTK the same.

Sorin

--- Scott <syrinx@simplecom.net> wrote:
> Hi. I'm using a SplitterWindow, and I'm trying to
> get the window proportions to stay constant when the
> window is resized. My OnSize works when I drag a
> corner of the window around, but not when I maximize
> the window. Anyone know what I'm doing wrong?
> Thanks. (Linux, GTK, wxPython 2.4.1.2)
>
> def OnSize(self, event):
> event.Skip()
> w = event.GetSize().GetWidth()
>
>
>
self.splitter.SetSashPosition(int(float(w)*self.sashProportion),
> True)

Scott wrote:

Hi. I'm using a SplitterWindow, and I'm trying to get the window proportions to stay constant when the window is resized. My OnSize works when I drag a corner of the window around, but not when I maximize the window. Anyone know what I'm doing wrong? Thanks. (Linux, GTK, wxPython 2.4.1.2)

    def OnSize(self, event):
      event.Skip()
        w = event.GetSize().GetWidth() self.splitter.SetSashPosition(int(float(w)*self.sashProportion), True)
     
Are you getting a not getting a size event when maximized, or is the SetSashPosition not working when called after a maximize? Do the newer versions of wxPython behave any differently?

···

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

It was a dumb error where I set up the event handler. I tried to figure it out for hours last nigth, without success. I came back tonight, and it was glaringly obvious. Sorry.

···

On Wed, 12 May 2004 09:10:10 -0700 Robin Dunn <robin@alldunn.com> wrote:

Scott wrote:
> Hi. I'm using a SplitterWindow, and I'm trying to get the window proportions to stay constant when the window is resized. My OnSize works when I drag a corner of the window around, but not when I maximize the window. Anyone know what I'm doing wrong? Thanks. (Linux, GTK, wxPython 2.4.1.2)
>
> def OnSize(self, event):
> event.Skip()
> w = event.GetSize().GetWidth()
> self.splitter.SetSashPosition(int(float(w)*self.sashProportion), True)
>

Are you getting a not getting a size event when maximized, or is the
SetSashPosition not working when called after a maximize? Do the newer
versions of wxPython behave any differently?