Preventing access to other frames while another frame is open

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
Landun
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Mar 28, 2023 7:33 am

Preventing access to other frames while another frame is open

Post by Landun »

Hi, I'm still kinda green to wxWidgets. Well, alot actually. I am aware that some programs I used in the past would lock the previous screen if you had a dialogueBox or another window pulled up. Every time you clicked away from the current DialogueBox it'd flash a bit and you'd get a system noise, and you wouldn't be able to do anything until you interacted with the Dialogue Box properly. In my case, I have two frames, and I'd like to replicate that with the second frame, where it would prevent access with the first frame until it is properly interacted with. Is there any function in the WXwidgets library that does that?
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Preventing access to other frames while another frame is open

Post by doublemax@work »

If you have a modal dialog, you should use a wxDialog for it, not a wxFrame. Then you should show is using ShowModal(), not Show(). Also, most dialogs should be created on the stack when you need them, not on the heap.
Post Reply