Page 1 of 1

Call dialog from predicate?

Posted: 22 May 2021 0:44
by dcgreenwood
I get that I can post dialogs/forms from a menu, and can manage my application by starting with a menu item, it runs until it stops/succeeds, then I can use another menu item to post a dialog to put in input and then run the program again with the same or different menu item.

But can you post a dialog from within a running predicate? This would allow the program to pause while it waits for input then the OK button could resume where it stopped.

I don't see anything about this in the tutorial, and I'm guessing it doesn't work that way, but I wanted to ask.

Re: Call dialog from predicate?

Posted: 24 May 2021 22:07
by Thomas Linder Puls
You can show a dialog from any part of your code.

Code: Select all

    D = myDialog::display(applicationWindow::get(), .......),
But usually it is a bad idea to "block" the program and ask for input (using a modal dialog).

Have you read Dialogs and Forms and looked at Dialogs and Forms: Modeless dialogs example.

Re: Call dialog from predicate?

Posted: 28 May 2021 15:11
by Harrison Pratt
The 'continueDialog' project referenced in the Dialogs and Forms: Modeless dialogs example
( http://discuss.visual-prolog.com/viewtopic.php?t=8218 ) uses an older VP syntax and could pose some challenges to people new to VP. I have attached a tweaked version that compiles smoothly with Vip9x.