Bug with hidden widgets on window creation/show

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
delt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Dec 26, 2016 11:17 pm

Bug with hidden widgets on window creation/show

Post by delt » Fri Mar 03, 2017 4:25 am

If a widget is hidden when the window is shown/created, showing this widget afterwards seems to stick it at the top level of the window, even if it's supposed to be in a (different?) sizer. Calling Layout () on my window doesn't change it. Is this behaviour expected?

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

Re: Bug with hidden widgets on window creation/show

Post by doublemax » Fri Mar 03, 2017 7:45 am

Does the window "snap" to the right position when you resize the window? If yes, calling Layout() should fix it. If calling Layout on the frame doesn't help, try calling it on the topmost sizer.

If that doesn't help, please show some code, ideally a minimal, compilable sample that shows the problem.
Use the source, Luke!

delt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Dec 26, 2016 11:17 pm

Re: Bug with hidden widgets on window creation/show

Post by delt » Sun Mar 05, 2017 4:20 am

Calling topmost_sizer->Layout () solves the problem with hidden widgets being placed in the wrong sizer, thanks very much for that tip.

In another instance, in windows my widgets are taking only the top left 32 pixels of their tab page. Resizing the window "snaps" everything back into place, but calling Layout () on the window itself, and on various sizers/panels/etc. doesn't help. This works fine on linux and osx.

Post Reply