# User interaction¶

This page describes global functions that allow you to interact with the user.

## Global functions¶

warning(message[, title])

Displays a warning dialog.

See also: alert()

alert(message[, title])

Displays an error dialog. This can be used for critical errors.

See also: warning()

info(message[, title])

Displays an information dialog.

ask(message[, title])

Asks a Yes/No question to the user. Returns true of the user clicked Yes, and false otherwise.

get_input(label, title, text)

Displays an input dialog whose title is title and whose informative text is label. The dialog contains a field whose value is text. This function returns the content of the field.

open_file_dialog(message)

Displays a dialog that lets the user select a file.

save_file_dialog(message)

Displays a dialog that lets the user choose a path to save a file.

open_directory_dialog(message)

Displays a dialog that lets the user select a directory.

set_status(message, timeout)

Displays message in the status bar for timeout seconds. If timeout is 0, the message is displayed until the next one appears.

view_text(path[, title[, width]])

Opens the plain text file path in a new dialog. Optionally, you can specify the dialog’s title and set its width.