Proper sizing at start problem.

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
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Proper sizing at start problem.

Post 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 1037 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 1037 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?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Proper sizing at start problem.

Post 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.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Proper sizing at start problem.

Post by doublemax »

First thing to try is to call SendSizeEvent() on the toplevel window:
https://docs.wxwidgets.org/trunk/classw ... 5fa82ba4c2
Use the source, Luke!
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Proper sizing at start problem.

Post 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)
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Proper sizing at start problem.

Post by doublemax »

Try executing SendSizeEvent after ShowFullScreen has been processed and all events handled:

Code: Select all

ShowFullScreen();
CallAfter( [this] {
  SendSizeEvent();
});
Use the source, Luke!
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Proper sizing at start problem.

Post 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.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Proper sizing at start problem.

Post by doublemax »

Another try: Call Layout() on the topmost sizer (not window) in the sizer hierarchy.
Use the source, Luke!
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Proper sizing at start problem.

Post by Parduz »

nope, no changes.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Proper sizing at start problem.

Post by doublemax »

sorry, then i'm out of ideas.
Use the source, Luke!
Post Reply