dialog.runModeless

Syntax dialog.runModeless (resnum, defaultitem, itemhitcallback)

Params resnum is the resource number of a DLOG resource

defaultitem is the item that's bold in the dialog and acts as the default response if the user hits the Return or Enter key.

itemhitcallback is the address of a script to be executed when an item in the dialog is hit and the user's action must be processed.

Action Runs a modeless dialog

Returns True

Examples See the Frontier script search.dialog for an example of the use of this verb.
Platform Notes This verb is only implemented in the Mac OS version of Frontier.

Notes This verb opens a new window to run the dialog. The window stays around while you're running Frontier and the callback routine gains control when you click on a button.

The callback script must accept a single parameter that is the number of the item hit. It should return false to dismiss the dialog, true continue accepting user input.

Before the dialog is displayed and user input is accepted, the callback script is called with the special item value -1, to allow it to initialize the dialog's items as appropriate.

If the user clicks in the dialog window's close box, the callback script is called with the special item value -2, to allow it to perform any final actions. In this one case, the value returned by the callback is ignored.

The callback script can call clock.sleepFor to request that it be called again in a specified period, if no user input is received. The script will be called with the special item value -3 to indicate that that the user didn't select an item.

If a dialog with the same resnum is already running from another script, executing this verb brings that dialog to the front and returns true, but itemhitcallback is not called.

See Also clock.sleepFor

dialog.run

Discuss