Hi
In the attached sample the first time the grid has a scrollbar but as
soon as I resize the frame the grid scrollbar is gone and will not come
back automatically.
Is there something to make it work?, has it something to do with the
gridbagsizer that expands beyond the frame limits?
Hi
In the attached sample the first time the grid has a scrollbar but as
soon as I resize the frame the grid scrollbar is gone and will not come
back automatically.
Is there something to make it work?, has it something to do with the
gridbagsizer that expands beyond the frame limits?
You should set the size hints, where you create your sizer:
Hi
In the attached sample the first time the grid has a scrollbar but as
soon as I resize the frame the grid scrollbar is gone and will not come
back automatically.
Is there something to make it work?, has it something to do with the
gridbagsizer that expands beyond the frame limits?
Yes, it does have to do with the GBS, but it's not really a bug. Basically what is happening is that the items in the expandable rows and cols are checked for the best or minimal size, and the rows and columns are expanded to accommodate those sizes. There is nothing that says that that expansion must be constrained to the size of the window (although that might be a nice feature to add.)
In this case when the Grid gets some data its best size changes to be able to show all the cells, and when the frame's size changes the next time the sizer's Layout uses that new best size in the layout calculation. The workaround is to not let the sizer use the grid's best size. You can do that by overriding it with a min size setting.
class CustTableGrid(gridlib.Grid):
def __init__(self, parent, log):
gridlib.Grid.__init__(self, parent, -1)
self.SetMinSize((10,10))
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!