Disable resizing wxFrame/wxWindow on Mac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Disable resizing wxFrame/wxWindow on Mac

Post by Anil8753 »

I want to stop the resizing of wxFrame for a time period. To achieve I used the following line on the run time.

Code: Select all

SetWindowStyle(wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX))
This is as per documentation (http://docs.wxwidgets.org/trunk/classwx_frame.html)

On windows, it works as expected. Resize border is removed and maximise button is disabled, but on Mac this is not working. Resize border is available and maximise button is enabled.
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Disable resizing wxFrame/wxWindow on Mac

Post by jgrzybowski »

According the docs you can consider to use SetWindowStyleFlag and read the note below from documenetaion:
Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
Regards, Jarek
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Disable resizing wxFrame/wxWindow on Mac

Post by Anil8753 »

SetWindowStyle is a just wrapper over SetWindowStyleFlag.

"Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately."

Tried the above but useless. :evil:
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Disable resizing wxFrame/wxWindow on Mac

Post by jgrzybowski »

I am not a user of Mac, but I can try to suggest note form docs about Refresh():
Note that repainting doesn't happen immediately but only during the next event loop iteration, if you need to update the window immediately you should use Update() instead.
Regards, Jarek
Post Reply