ScrolledWindow sizing issues

James Bigler bigler at cs.utah.edu
Wed Mar 7 12:50:03 PST 2007


I almost have what I want.  I found out how to make a table show up without=
 any =

scrollbars by adjusting the sizes of the columns.  The problem I'm having n=
ow is =

how to place it inside my dialog with a ScrolledWindow.

Here's the general idea (I've attached the whole file as well):

         panel =3D wx.Panel(self, wx.ID_ANY)
         scrolled =3D wx.ScrolledWindow(panel, wx.ID_ANY,
                                      size=3Dwx.Size(400,200),
                                      style=3Dwx.VSCROLL)

         # Now we add the grid with the info in it
         grid =3D MyGrid(scrolled, wx.ID_ANY)
         gridSize =3D wx.Size(400,400)
         # Set up column sizes and add data

         # Make the row heights based on the amount of words (word wrapping)
         grid.AutoSizeRows()

         # The supposedly this will set the virtual size
         gridSizer =3D wx.BoxSizer(wx.VERTICAL)
         gridSizer.Add(grid, 1, wx.EXPAND)
         scrolled.SetSizer(gridSizer)
         # Add the panel to the sizer it will be placed in
         self.left_margin.Add(panel, 1, wx.EXPAND | wx.ALL )

There's two problems with this code.

1. I can't scroll down to the bottom, though there is some scrolling action =

going on.
2. If I resize my dialog, the ScrolledWindow doesn't get bigger.

Any help or pointers will be appreciated.

Thanks,
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table.py
Type: text/x-python
Size: 6343 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
307/2dffc820/table.py


More information about the wxpython-users mailing list