The "view" module manages the functions which perform drawing operations.
Module name
The following functions are defined as:
Function | Description | Operation object |
---|---|---|
get_file_path_with_dialog | Gets the file path | - |
show_dialog | Shows the dialog | - |
Gets the path of the selected file using the dialog.
The input argument mode
specifies the type of dialog you want to display. The two modes are "open" and "save".
suffix
. There are 3 ways to specify it: folder_path
argument. If omitted, the "Documents" folder is used as the initial path.This function was added in Ver.3.46.04.
Name | Value |
---|---|
mode | Type of the dialog |
suffix | File extension of the files displayed in the dialog |
folder_path | Default folder to open in the dialog |
Name | Value |
---|---|
result [ "succeed" ] | True if succeeded, False if failed |
result [ "data" ] | String that contains the selected file path |
Shows the dialog.
The dialog provides the text area which supports copy to clipboard, and up to three buttons.
The input argument message
specifies the text to be displayed. Use \n
to jump to the next line.
The input argument button_name_list
specifies the texts on the buttons as a list. You can specify up to three buttons.
["Yes", "No", "Cancel"]
in button_name_list
.["OK"]
in button_name_list
.The return value is given as an associative array.
The associative array have two keys: button_index
and button_name
.
The value of the button_index
key is the index of the button pressed (the index is zero-based).
The value of the button_name
key is the text of the button pressed.
If the user closes the dialog by pressing the X button, the index will be -1 and the name will be an empty string.
This function was added in Ver.3.45.00.
Name | Value |
---|---|
message | Text to be shown |
button_name_list | List of the button names (up to three) |
Name | Value |
---|---|
result [ "succeed" ] | True if succeeded, False if failed |
result [ "data" ] | An associative array with button_index and button_name keys |
result [ "data" ][ "button_index" ] | Index of the button pressed (zero-based) -1 when no button was pressed |
result [ "data" ][ "button_name" ] | Text of the button pressed |