Skip to main content
Version: 8.1

system.gui.inputBox

This function is used in Python Scripting.

Description

Opens up a popup input dialog box. This dialog box will show a prompt message and allow the user to type in a string. When the user is done, they can click OK or Cancel. If OK is pressed, this function will return with the value that they typed in. If Cancel is pressed, this function will return the value None.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.gui.inputBox(message, defaultText)

Parameters

TypeParameterDescription
StringmessageThe message to display for the input box. Will accept HTML formatting.
StringdefaultTextThe default text to initialize the input box with.

Returns

String - The string value that was entered in the input box.

Scope

Vision Client

Code Examples

Example #1
# In the mouseClicked event of a label, this allows the user to change the label's text.

txt = system.gui.inputBox("Enter text:", event.source.text)
if txt != None:
event.source.text = txt

Keywords

system gui inputBox, gui.inputBox