Documentation

GUI Functions

These functions can add, remove or modify widgets for a GUI step in RPGM.

gui.add(step, id, type)

Added in v3
Adds a new widget in a GUI.

  • id is the ID of the new widget
  • type is the type of the widget. See the widget type documentation page.

gui.remove(step, id)

Removes a widget from a GUI.

gui.setProperties(step, id, properties)

Added in v3
Sets a list of properties for a widget.

  • properties is a list of property/value

The complete list of properties is available on the Widget Properties page.

gui.setProperty(step, id, property, value)

Added in v3
Set a single property for a widget. Shortcut of gui.setProperties(step, id, list(property=value)

gui.showModal(title, content)

Added in v3
Displays a modal with a title and a content. Supports HTML.

gui.update(step, id)

Added in v3
Updates a widget by re-evaluating its initial value in R.

Properties Shortcuts

gui.showMessage(step, id, type, message)

Shows a message below a widget.

  • type can be either "error", "warning" or "success".

Shortcut to gui.setProperties(step, id, list(messageType=type, messageText=message))

gui.hideMessage(step, id)

Hides the message below a widget.

Shortcut to gui.setProperties(step, id, list(messageText=""))

gui.setValue(step, id, value)

Set the value of a widget.

Shortcut to gui.setProperties(step, id, list(value=value))

gui.enable(step, id)

Enables a widget's input previously disabled.

Shortcut to gui.setProperties(step, id, list(enabled=TRUE))

gui.disable(step, id)

Disables a widget's input.

Shortcut to gui.setProperties(step, id, list(enabled=FALSE))

gui.show(step, id)

Shows a widget previously hidden.

Shortcut to gui.setProperties(step, id, list(visible=TRUE))

gui.hide(step, id)

Hides a widget.

Shortcut to gui.setProperties(step, id, list(visible=FALSE))

Choices

gui.addChoice(step, id, value, text)

Adds a choice to a select widget.

gui.addChoices(step, id, values, texts)

Adds multiples choices to a select widget. values and texts can be either a list or a simple vector like c(). values and texts must have the same length.

gui.clearChoices(step, id)

Clears all the choices in a select widget.

gui.setChoiceText(step, id, value, text)

Sets the text of a select widget's choice.

  • value is the value of the option to change
  • text is the new text of the option

gui.removeChoice(step, id, value)

Removes a specific choice in a select widget by the value of the choice.

Legacy

All those functions are deprecated in v3.

gui.showError(step, id, error)

Deprecated in v3
Displays an error message below a widget. Replaced by gui.showMessage(step, id, "error", message)

gui.showWarning(step, id, warning)

Deprecated in v3
Displays a warning message below a widget. Replaced by gui.showMessage(step, id, "warning", message)

gui.showSuccess(step, id, text)

Deprecated in v3
Displays a success message below a widget. Replaced by gui.showMessage(step, id, "success", message)

gui.hideError(step, id)

Deprecated in v3
Hides an error message below a widget. Replaced by gui.hideMessage(step, id)

gui.setChoiceValue(step, id, text, value)

Deprecated in v3
Changes the value of a widget of type select given its text.

Removed From v3

  • rpgm.add<WidgetName>: all those functions were removed.
  • gui.setChoiceValue(step, id, text, value): Removed as changing value is a bad practice and because giving the text as the selector is also a bad practice.
  • rpgm.addchoice: Old alias of gui.addChoice already deprecated in v2.
  • rpgm.addfield: Old v1 function replaced by gui.add()
  • rpgm.showerror: Old v1 function replaced by gui.setMessage()