I'm new to wxWidget and I have read several demos given by the wxWidget package, but none of them is 'multi interface' (I don't know if there is a terminology for this either, sorry).
Say I want to write a simple game using wxWidget, I may need a menu interface, a game interface, a setting interface and so on. My question is how can I build them into a single App? Do I need several wxFrame and Close and Show them from time to time? (However when I close it the application is terminated) Or is there an another way?
How to build 'multi interface' application Topic is solved
Re: How to build 'multi interface' application
That should only happen when the last frame is destroyed. Usually you'd have one main frame, the interface for the settings could be a modal dialog or another frame.However when I close it the application is terminated
You can prevent a frame from being destroyed when it's closed by catching the wxEVT_CLOSE event. E.g. you could just call Hide() in there.
Use the source, Luke!
Re: How to build 'multi interface' application
Many Thanks!doublemax wrote: ↑Fri May 21, 2021 7:49 amThat should only happen when the last frame is destroyed. Usually you'd have one main frame, the interface for the settings could be a modal dialog or another frame.However when I close it the application is terminated
You can prevent a frame from being destroyed when it's closed by catching the wxEVT_CLOSE event. E.g. you could just call Hide() in there.
But still I am wandering if I can change the contents of the window itself rather than let another window pop out ? I could handle the settings by dialog but it seems weird to have a new window when I start a new game.
Re: How to build 'multi interface' application
What kind of game are we talking about? Is it completely custom-drawn, or will it have any standard GUI elements?
Another alternative to having multiple windows could be to have each "interface" on a different wxPanels and put them in a wxSimpleBook. Then you can switch between the panels with a single call.
Another alternative to having multiple windows could be to have each "interface" on a different wxPanels and put them in a wxSimpleBook. Then you can switch between the panels with a single call.
Use the source, Luke!
Re: How to build 'multi interface' application
It is a card game like UNO. (This is actually an OOP project so it's really no big deal)doublemax wrote: ↑Fri May 21, 2021 10:35 am What kind of game are we talking about? Is it completely custom-drawn, or will it have any standard GUI elements?
Another alternative to having multiple windows could be to have each "interface" on a different wxPanels and put them in a wxSimpleBook. Then you can switch between the panels with a single call.