Page 1 of 1

Proper sizing at start problem.

Posted: Wed Dec 11, 2019 2:18 pm
by Parduz
Using wxWidgets 3.1.2 in a debian environment, this is how my app opens:
WxResizeProblem1.png
WxResizeProblem1.png (13.86 KiB) Viewed 576 times
The top-right label is out of the bounds, and also the central panel seems not resized..

...as this is how it appears after i resize the window (using the mouse) by one pixel
WxResizeProblem2.png
WxResizeProblem2.png (15.66 KiB) Viewed 576 times
and now everything is how i want it to be.

Problem is that i want to run it at full screen (i maximize the frame with

Code: Select all

ShowFullScreen(true,wxFULLSCREEN_ALL)
and the form appears as in the first picture.

Why the labels are not already sized?
What should i call to ensure that everything looks right?

Re: Proper sizing at start problem.

Posted: Wed Dec 11, 2019 5:14 pm
by ONEEYEMAN
Hi,
Can you show some code?
Specifically how you create the top label and how do you add it to the sizer (if you use any)? And how this sizer being added to the whole hierarchy?

Also, did it work correctly on the previous version of wx?

Thank you.

Re: Proper sizing at start problem.

Posted: Wed Dec 11, 2019 5:37 pm
by doublemax
First thing to try is to call SendSizeEvent() on the toplevel window:
https://docs.wxwidgets.org/trunk/classw ... 5fa82ba4c2

Re: Proper sizing at start problem.

Posted: Thu Dec 12, 2019 10:35 am
by Parduz
doublemax wrote:
Wed Dec 11, 2019 5:37 pm
First thing to try is to call SendSizeEvent() on the toplevel window:
https://docs.wxwidgets.org/trunk/classw ... 5fa82ba4c2
It works only if
  1. i call it after the frame->show() call
  2. i then break before the SendSizeEvent() call and then let it run. Without the breakpoint, it changes nothing.
This on the Debian PC. On the BBB (arm) i can't break (and there also it calls ShowFullScreen()), so there it just does'nt change (and i have the misaligned look)

Re: Proper sizing at start problem.

Posted: Thu Dec 12, 2019 10:51 am
by doublemax
Try executing SendSizeEvent after ShowFullScreen has been processed and all events handled:

Code: Select all

ShowFullScreen();
CallAfter( [this] {
  SendSizeEvent();
});

Re: Proper sizing at start problem.

Posted: Thu Dec 12, 2019 4:37 pm
by Parduz
doublemax wrote:
Thu Dec 12, 2019 10:51 am
Try executing SendSizeEvent after ShowFullScreen has been processed and all events handled:

Code: Select all

ShowFullScreen();
CallAfter( [this] {
  SendSizeEvent();
});
No changes; also, the ShowFullScreen happens only under the __arm__ define, so in the PC it does'nt happens.

Re: Proper sizing at start problem.

Posted: Thu Dec 12, 2019 4:39 pm
by doublemax
Another try: Call Layout() on the topmost sizer (not window) in the sizer hierarchy.

Re: Proper sizing at start problem.

Posted: Fri Dec 13, 2019 3:09 pm
by Parduz
nope, no changes.

Re: Proper sizing at start problem.

Posted: Fri Dec 13, 2019 3:25 pm
by doublemax
sorry, then i'm out of ideas.