Drawing a wx.grid.Grid without scrollbars

I am drawing a grid, together with other widgets, in a panel of a tabbed notebook. I am using wx.DefaultSize and putting it in an expandable BoxSizer.

If I create the grid while that tabbed panel is being displayed, it always adds horizontal and vertical scrollbars although the overall size of the grid is sufficient to contain the whole grid if the scrollbars weren’t being drawn. In fact if I visit a different page on the notrebook and tab back again, the grid is correctly displayed without the scrollbars.

Is there any way to create the grid while that page is visible but without the scrollbars? I’ve tried various combinations of CallAfter / notebook panel / Refresh() but without success.

···

Regards

David Hughes

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/1082534f-329c-4366-9c6b-1333253b7af5%40googlegroups.com.

Hi David,

I am drawing a grid, together with other widgets, in a panel of a tabbed notebook. I am using wx.DefaultSize and putting it in an expandable BoxSizer.

If I create the grid while that tabbed panel is being displayed, it always adds horizontal and vertical scrollbars although the overall size of the grid is sufficient to contain the whole grid if the scrollbars weren’t being drawn. In fact if I visit a different page on the notrebook and tab back again, the grid is correctly displayed without the scrollbars.

Is there any way to create the grid while that page is visible but without the scrollbars? I’ve tried various combinations of CallAfter / notebook panel / Refresh() but without success.

Did you try to force a resize of your main notebook/frame? Just a shot in the dark, but sometimes for me it works if I call SendSizeEvent on the top container window or, when everything else fails, I brutally do something like this:

size = self.GetSize()

self.SetSize(wx.Size(size[0]+1, size[1]))

self.SetSize(size)

On the top window container - maybe with Freeze() and Thaw() in between.

Andrea.

···

On Mon, 29 Jul 2019 at 17.06, David Hughes dfh@forestfield.co.uk wrote:

Regards

David Hughes

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/1082534f-329c-4366-9c6b-1333253b7af5%40googlegroups.com.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAEf70bzVD8pF-GFrrHaVVWshYAGjMCoHsQe-of_r2L%2BnDKU4xg%40mail.gmail.com.

Yes:

     <panel>\.SendSizeEvent\(wx\.SEND\_EVENT\_POST\)

works, as does the more readable equivalent of calling the function with this flag:

     <grid>\.PostSizeEventToParent\(\)

Thanks!

···

On 29/07/2019 16:10, Andrea Gavana wrote:

Did you try to force a resize of your main notebook/frame? Just a shot in the dark, but sometimes for me it works if I call SendSizeEvent on the top container window . . .

--
Regards

David Hughes
Forestfield Software

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/08043df2-45d9-818e-cf56-4afc7eb8fe04%40forestfield.co.uk.

Hi David,

Try this:

Hide vertical and horizontal scroll bars:

grid_object.ShowScrollbars(wx.SHOW_SB_NEVER,wx.SHOW_SB_NEVER)
···

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/1e678178-79b5-4c9c-b34a-6e480491e556%40googlegroups.com.