sashwindow

hell i'm playing around with sashwindows for the first time and i'm sure i've scrwed it up in some way but i can' see how from the demo. i just want to make 2 window (left and bottom "frame") and left the space in the top right as free as possible. when i attempt this i just see all my grid objects squashed up into the top left corner so i suspect my implementation of layout is somehow wrong.
www.wxpython.org seems to be down for me so i can't even go there to see if there's a tut.

class RosterTabPanel(wx.Panel):
    def __init__(self, parent,id):
        wx.Panel.__init__(self, parent, -1)
               self.parent = parent
        self.remainingSpace = wx.Panel(self,-1)
               win = wx.SashLayoutWindow(self, -1,
        wx.DefaultPosition, wx.Size(200, 30),
        wx.NO_BORDER|wx.SW_3D)
        win.SetDefaultSize(wx.Size(120, 1000))
        win.SetOrientation(wx.LAYOUT_VERTICAL)
        win.SetAlignment(wx.LAYOUT_LEFT)
        win.SetSashVisible(wx.SASH_RIGHT, True)
        win.SetExtraBorderSize(10)
        self.leftWindow = win
               win = wx.SashLayoutWindow(self, -1,
        wx.DefaultPosition, wx.Size(200, 30),
        wx.NO_BORDER|wx.SW_3D)
        win.SetDefaultSize(wx.Size(1000, 30))
        win.SetOrientation(wx.LAYOUT_HORIZONTAL)
        win.SetAlignment(wx.LAYOUT_BOTTOM)
        win.SetSashVisible(wx.SASH_TOP, True)
               self.bottomWindow = win
               self.RosterWorkSheetGrid = RosterWorkSheetGrid(self.remainingSpace)
        self.RosterTotalGrid = RosterWorkSheetTotalGrid(self.bottomWindow,-1)
        self.RosterStaffGrid = RosterStaffGrid(self.leftWindow)

       wx.LayoutAlgorithm().LayoutWindow(self, self.remainingSpace)

Usually when objects are squashed in a corner that means either 1) you didn’t use a sizer or 2) your sizer/windows weren’t set to expand, so maybe put your grids in sizers with (1, flag=wx.EXPAND) and then call SetSizer() with the parents? Also, I wonder if the parent of the remainingSpace window should be the SashLayoutWindow? Though I haven’t done a sashwindow before.

Lee

···

On Mon, 2006-11-06 at 10:40 +1000, Timothy Smith wrote:

hell i'm playing around with sashwindows for the first time and i'm sure
i've scrwed it up in some way but i can' see how from the demo. i just
want to make 2 window (left and bottom "frame") and left the space in
the top right as free as possible. when i attempt this i just see all
my grid objects squashed up into the top left corner so i suspect my
implementation of layout is somehow wrong.
[www.wxpython.org](http://www.wxpython.org) seems to be down for me so i can't even go there to see
if there's a tut.


class RosterTabPanel(wx.Panel):
    def __init__(self, parent,id):
        wx.Panel.__init__(self, parent, -1)

        self.parent = parent
        self.remainingSpace = wx.Panel(self,-1)

        win = wx.SashLayoutWindow(self, -1,
        wx.DefaultPosition, wx.Size(200, 30),
        wx.NO_BORDER|wx.SW_3D)
        win.SetDefaultSize(wx.Size(120, 1000))
        win.SetOrientation(wx.LAYOUT_VERTICAL)
        win.SetAlignment(wx.LAYOUT_LEFT)
        win.SetSashVisible(wx.SASH_RIGHT, True)
        win.SetExtraBorderSize(10)
        self.leftWindow = win

        win = wx.SashLayoutWindow(self, -1,
        wx.DefaultPosition, wx.Size(200, 30),
        wx.NO_BORDER|wx.SW_3D)
        win.SetDefaultSize(wx.Size(1000, 30))
        win.SetOrientation(wx.LAYOUT_HORIZONTAL)
        win.SetAlignment(wx.LAYOUT_BOTTOM)
        win.SetSashVisible(wx.SASH_TOP, True)

        self.bottomWindow = win

        self.RosterWorkSheetGrid = RosterWorkSheetGrid(self.remainingSpace)
        self.RosterTotalGrid =
RosterWorkSheetTotalGrid(self.bottomWindow,-1)
        self.RosterStaffGrid = RosterStaffGrid(self.leftWindow)

       wx.LayoutAlgorithm().LayoutWindow(self, self.remainingSpace)

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

“There is nothing remarkable about it. All one has to do is press the right keys at the right time and the computer programs itself.” (ala J.S. Bach)

Unless otherwise stated, any views presented in this e-mail are solely those of the author and do not necessarily represent those of the company.

Lee Merrill wrote:

Usually when objects are squashed in a corner that means either 1) you didn't use a sizer or 2) your sizer/windows weren't set to expand, so maybe put your grids in sizers with (1, flag=wx.EXPAND) and then call SetSizer() with the parents? Also, I wonder if the parent of the remainingSpace window should be the SashLayoutWindow? Though I haven't done a sashwindow before.

Lee

hell i'm playing around with sashwindows for the first time and i'm sure i've scrwed it up in some way but i can' see how from the demo. i just want to make 2 window (left and bottom "frame") and left the space in the top right as free as possible. when i attempt this i just see all my grid objects squashed up into the top left corner so i suspect my implementation of layout is somehow wrong.
www.wxpython.org <http://www.wxpython.org> seems to be down for me so i can't even go there to see if there's a tut.

class RosterTabPanel(wx.Panel):
   def __init__(self, parent,id):
       wx.Panel.__init__(self, parent, -1)
             self.parent = parent
       self.remainingSpace = wx.Panel(self,-1)
             win = wx.SashLayoutWindow(self, -1,
       wx.DefaultPosition, wx.Size(200, 30),
       wx.NO_BORDER|wx.SW_3D)
       win.SetDefaultSize(wx.Size(120, 1000))
       win.SetOrientation(wx.LAYOUT_VERTICAL)
       win.SetAlignment(wx.LAYOUT_LEFT)
       win.SetSashVisible(wx.SASH_RIGHT, True)
       win.SetExtraBorderSize(10)
       self.leftWindow = win
             win = wx.SashLayoutWindow(self, -1,
       wx.DefaultPosition, wx.Size(200, 30),
       wx.NO_BORDER|wx.SW_3D)
       win.SetDefaultSize(wx.Size(1000, 30))
       win.SetOrientation(wx.LAYOUT_HORIZONTAL)
       win.SetAlignment(wx.LAYOUT_BOTTOM)
       win.SetSashVisible(wx.SASH_TOP, True)
             self.bottomWindow = win
             self.RosterWorkSheetGrid = RosterWorkSheetGrid(self.remainingSpace)
       self.RosterTotalGrid = RosterWorkSheetTotalGrid(self.bottomWindow,-1)
       self.RosterStaffGrid = RosterStaffGrid(self.leftWindow)

      wx.LayoutAlgorithm().LayoutWindow(self, self.remainingSpace)

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

---
"There is nothing remarkable about it. All one has to do is press the right keys at the right time and the computer programs itself." (ala J.S. Bach)

Unless otherwise stated, any views presented in this e-mail are solely those of the author and do not necessarily represent those of the company.

from what i could understand of the sash windows, wx.LayoutAlgorithm takes the place of sizers as a way of organising objects on the screen.
i did initally try a sier, but then i got blank windows with nothing on them.

···

On Mon, 2006-11-06 at 10:40 +1000, Timothy Smith wrote:

Timothy Smith wrote:

Lee Merrill wrote:

Usually when objects are squashed in a corner that means either 1) you didn't use a sizer or 2) your sizer/windows weren't set to expand, so maybe put your grids in sizers with (1, flag=wx.EXPAND) and then call SetSizer() with the parents? Also, I wonder if the parent of the remainingSpace window should be the SashLayoutWindow? Though I haven't done a sashwindow before.

Lee

hell i'm playing around with sashwindows for the first time and i'm sure i've scrwed it up in some way but i can' see how from the demo. i just want to make 2 window (left and bottom "frame") and left the space in the top right as free as possible. when i attempt this i just see all my grid objects squashed up into the top left corner so i suspect my implementation of layout is somehow wrong.
www.wxpython.org <http://www.wxpython.org> seems to be down for me so i can't even go there to see if there's a tut.

class RosterTabPanel(wx.Panel):
   def __init__(self, parent,id):
       wx.Panel.__init__(self, parent, -1)
             self.parent = parent
       self.remainingSpace = wx.Panel(self,-1)
             win = wx.SashLayoutWindow(self, -1,
       wx.DefaultPosition, wx.Size(200, 30),
       wx.NO_BORDER|wx.SW_3D)
       win.SetDefaultSize(wx.Size(120, 1000))
       win.SetOrientation(wx.LAYOUT_VERTICAL)
       win.SetAlignment(wx.LAYOUT_LEFT)
       win.SetSashVisible(wx.SASH_RIGHT, True)
       win.SetExtraBorderSize(10)
       self.leftWindow = win
             win = wx.SashLayoutWindow(self, -1,
       wx.DefaultPosition, wx.Size(200, 30),
       wx.NO_BORDER|wx.SW_3D)
       win.SetDefaultSize(wx.Size(1000, 30))
       win.SetOrientation(wx.LAYOUT_HORIZONTAL)
       win.SetAlignment(wx.LAYOUT_BOTTOM)
       win.SetSashVisible(wx.SASH_TOP, True)
             self.bottomWindow = win
             self.RosterWorkSheetGrid = RosterWorkSheetGrid(self.remainingSpace)
       self.RosterTotalGrid = RosterWorkSheetTotalGrid(self.bottomWindow,-1)
       self.RosterStaffGrid = RosterStaffGrid(self.leftWindow)

      wx.LayoutAlgorithm().LayoutWindow(self, self.remainingSpace)

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

---
"There is nothing remarkable about it. All one has to do is press the right keys at the right time and the computer programs itself." (ala J.S. Bach)

Unless otherwise stated, any views presented in this e-mail are solely those of the author and do not necessarily represent those of the company.

from what i could understand of the sash windows, wx.LayoutAlgorithm takes the place of sizers as a way of organising objects on the screen.
i did initally try a sier, but then i got blank windows with nothing on them.

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

i've got it working now. i had to use sizers on the sashwindows themselfs. layout is only for resizing the windows, right?

···

On Mon, 2006-11-06 at 10:40 +1000, Timothy Smith wrote:

Timothy Smith wrote:

i've got it working now. i had to use sizers on the sashwindows themselfs. layout is only for resizing the windows, right?

Yes.

···

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

Timothy Smith wrote:

i've got it working now. i had to use sizers on the sashwindows
themselfs. layout is only for resizing the windows, right?

Well, it’s useful to call Layout() on the parent window or sizer if you add/remove/hide/show child windows, for instance. Or if you do a manual resize, but then (in my experience) the Layout() call will plunk it back the way it was before, unless you set minimum size and use layout constraints, etc.

Lee

···

On Tue, 2006-11-07 at 09:06 +1000, Timothy Smith wrote:


“There is nothing remarkable about it. All one has to do is press the right keys at the right time and the computer programs itself.” (ala J.S. Bach)

Unless otherwise stated, any views presented in this e-mail are solely those of the author and do not necessarily represent those of the company.