cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

trouble making XUI dialog modal, what am I missing?

pnagai
4-Participant

trouble making XUI dialog modal, what am I missing?

Hi,

I am having trouble making a XUI dialog modal.

<window modal="true" ...

Isn't enough. In fact, when I set that, the dialog doesn't display at all. Do I need to do something specific on subsequent window_create() or window_show()?

I've scoured the code that ships with Editor and found that PTC uses _xmldlg::displayDialog(). I've required _xmldlg and mimicked the calls, but I'm still not getting it to work.

Anyone seen/solved this before?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Paul--

You might need to use event_process() and event_stop_process() to hijack event processing until the user is done with the dialog. Just make sure you catch all the exit points for the dialog to call event_stop_process()--if the users find a way to kill the dialog without calling that, it will leave editor in a wonky state, and may result in zombie processes when the user exits the application.

--Clay

View solution in original post

2 REPLIES 2

Hi Paul--

You might need to use event_process() and event_stop_process() to hijack event processing until the user is done with the dialog. Just make sure you catch all the exit points for the dialog to call event_stop_process()--if the users find a way to kill the dialog without calling that, it will leave editor in a wonky state, and may result in zombie processes when the user exits the application.

--Clay

pnagai
4-Participant
(To:ClayHelberg)

Thanks, Clay! That did indeed work.

I set <window modal="true"...

I called window_show(myxuiwin, 1);

I called event_process(0);

And then, as you suggested, on every button, ESC, or , the first thing I do is call:

event_stop_process(0)

The 0 is significant. If you provide a non-zero value, all input is suspended and the dialog itself is not accessible to the user until the ESC and then the dialog is available but not modal. Also, if you do the window_show() and event_process() timing wrong, very strange things happen.

Top Tags