This might end up to be trivial but I currently have a black-out and cannot figure out how to make a dialog-like behavior in wx.Panel. Basically, I want to create a menu item that when clicked it should create a OK/Cancel button and waits for the user to click OK/Cancel before carrying on with other script tasks in the menu item event. So the behavior I need is like a modal dialog that blocks script flow until it is dismissed. Other windows may or may not be blocked but better if they are not. I can probably do a dirty workaround but I feel there has to be a simple clean way.
On Friday, May 20, 2016 at 1:17:33 PM UTC-5, Emad Dlala wrote:
Hi Guys,
This might end up to be trivial but I currently have a black-out and cannot figure out how to make a dialog-like behavior in wx.Panel. Basically, I want to create a menu item that when clicked it should create a OK/Cancel button and waits for the user to click OK/Cancel before carrying on with other script tasks in the menu item event. So the behavior I need is like a modal dialog that blocks script flow until it is dismissed. Other windows may or may not be blocked but better if they are not. I can probably do a dirty workaround but I feel there has to be a simple clean way.
No, I don’t want a separate UI popping up. I want my OK/Cancel buttons embedded into an existing window. Message dialog creates a new UI which I don’t want
On Friday, May 20, 2016 at 1:17:33 PM UTC-5, Emad Dlala wrote:
Hi Guys,
This might end up to be trivial but I currently have a black-out and cannot figure out how to make a dialog-like behavior in wx.Panel. Basically, I want to create a menu item that when clicked it should create a OK/Cancel button and waits for the user to click OK/Cancel before carrying on with other script tasks in the menu item event. So the behavior I need is like a modal dialog that blocks script flow until it is dismissed. Other windows may or may not be blocked but better if they are not. I can probably do a dirty workaround but I feel there has to be a simple clean way.
If you don’t want to use the widgets that are pre-made, then you’ll have to reinvent the wheel yourself so that it does what you want. This is not built-in.
Mike
···
On Friday, May 20, 2016 at 2:04:41 PM UTC-5, Emad Dlala wrote:
No, I don’t want a separate UI popping up. I want my OK/Cancel buttons embedded into an existing window. Message dialog creates a new UI which I don’t want
Are you aware of yourpanel.MakeModal() ? See the docs:
MakeModal(self, modal=True)
Disables all other windows in the application so that the user can only
interact with this window. Passing False will reverse this effect.
Maybe you can use that to get what you want. I am not sure this is a good
UX idea, though. It breaks conventions/expectations.
···
On Fri, May 20, 2016 at 3:04 PM, Emad Dlala <emad.dlala@gmail.com> wrote:
No, I don't want a separate UI popping up. I want my OK/Cancel buttons
embedded into an existing window. Message dialog creates a new UI which I
don't want