next up previous contents index
Next: Text Input Up: Main Functions 2 Previous: Mouse Input   Contents   Index

Graphical Input

(string) PopUpInput(message, default, buttontext,, multiline)
This function will pop up a text-input widget, into which the user can enter text. The function blocks until the user presses the affirmation button, at which time the text is returned, and the pop-up disappears. If the user instead presses the Dismiss button or otherwise destroys the pop-up, the script will halt.

The first argument is an explanatory string which is printed on the pop-up. If this argument is null or empty, a default message is used. Recall that passing 0 is equivalent to passing a null string.

The second argument is a string providing default text which appears in the entry area when the pop-up appears. If this argument is null or empty there will be no default text.

The third argument is a string giving text that will appear on the affirmation button. If null or empty, the button will show a default label.

The fourth argument is a boolean that when nonzero, a multi-line text input widget will be used. Otherwise, a single-line input widget will be used.

(int) PopUpAffirm(message)
This button pops up a small window which allows the user to answer yes or no to a question. Deleting the window is equivalent to answering no. The argument is a string which should contain the text to which the user responds. When the user responds, the pop-up disappears, and the return value is 1 if the user answered ``yes'', 0 otherwise.

(real) PopUpNumeric(message, initval, minval, maxval, delta, numdgt)
This function pops up a small window which contains a ``spin button'' for numerical entry. The user is able to enter a number directly, or by clicking on the increment/decrement buttons.

The first argument is a string providing explanatory text. The second argument provides the initial numeric value. The minval and maxval arguments are the minimum and maximum allowed values. The delta argument is the delta to increment or decrement when the user presses the up/down buttons. These parameters are all real values. The numdgt is an integer value which sets how many places to the right of a decimal point are shown.

If the user presses Apply, the pop-up disappears, and this function returns the current value. If the user presses the Dismiss button or otherwise destroys the widget, the script will halt.


next up previous contents index
Next: Text Input Up: Main Functions 2 Previous: Mouse Input   Contents   Index
Stephen R. Whiteley 2024-09-29