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.
Anil8753
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Jan 16, 2016 5:57 am

Disable resizing wxFrame/wxWindow on Mac

Postby Anil8753 » Fri Jan 06, 2017 4:17 am

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
Experienced Solver
Experienced Solver
Posts: 97
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Disable resizing wxFrame/wxWindow on Mac

Postby jgrzybowski » Sat Jan 07, 2017 11:52 am

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
Knows some wx things
Knows some wx things
Posts: 43
Joined: Sat Jan 16, 2016 5:57 am

Re: Disable resizing wxFrame/wxWindow on Mac

Postby Anil8753 » Mon Jan 09, 2017 3:49 am

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
Experienced Solver
Experienced Solver
Posts: 97
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Disable resizing wxFrame/wxWindow on Mac

Postby jgrzybowski » Mon Jan 09, 2017 7:37 am

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


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 1 guest