wxGrids and sizers question

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Morat20
Knows some wx things
Knows some wx things
Posts: 35
Joined: Tue Jan 07, 2014 8:43 pm

wxGrids and sizers question

Post by Morat20 » Mon Mar 25, 2019 4:49 pm

I seem to have a reoccurring problem with wxGrids and being placed in sizers. I'll defined the grid minimum and maximum size, place it in the sizer, call the Layout() and the result looks correct.

The wxGrid will show scrollbars, fit inside the frame, and not extend past the edge of the frame.

Except on a resize() event. Resizing the main frame will 'jump' the wxGrid to the maximum size I set, rather than to a size that fits in the actual available space in the frame. The grid is now "wider" than the frame is. The horizontal scrollbar remains.

I suspect there's something I don't understand about wxGrids and sizers and the 'expand' flag that's tripping me up, and Google is not showing any good references to read up on the core behavior. Does anyone have any suggestions as to some basic background information on how sizers and wxGrids work?

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGrids and sizers question

Post by doublemax » Mon Mar 25, 2019 5:23 pm

Please post a minimal, compilable sample that shows the problem.
Use the source, Luke!

Post Reply