Discussions related to Visual Prolog
Posts: 24
Joined: 16 Jan 2021 1:33

Call dialog from predicate?

Unread post 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.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1253
Joined: 28 Feb 2000 0:01

Re: Call dialog from predicate?

Unread post 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.
Regards Thomas Linder Puls
Harrison Pratt
VIP Member
Posts: 353
Joined: 5 Nov 2000 0:01

Re: Call dialog from predicate?

Unread post 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.
(36.54 KiB) Downloaded 59 times
Post Reply