UserInterface Class
The UserInterface class allows interacting with PrestoPlot graphical user interface. For example, you can add buttons to toolbars to make some actions.
Public Functions
addGraphToolbarButton(graph, image, tooltip, script)
addMenuEntry(label, script)
addToolbarButton(image, tooltip, script)
loadImage(filename)
showMessage(title, message)
Detailed Functions Descriptions
addGraphToolbarButton
addGraphToolbarButton(graph, image, tooltip, script)
Add a button in a graph toolbar. An icon will take place in the Plugins group.
Parameters :
-
graph: A Graph object where the button will be added. -
image: The image identifier to display in the button. -
tooltip: The tooltip text to display when mouse hovers. -
script: The code being executed when the user clicks on the button. The$graphvariable will be available to access to the Graph object.
addMenuEntry
addMenuEntry(label, script)
Add an entry in the Plugin menu.
Parameters :
-
label: The menu label -
script: The code being executed when menu is activated by the user.
addToolbarButton
addToolbarButton(image, tooltip, script)
Add a button in the main PrestoPlot toolbar. The button will take place in the Plugins group.
Parameters :
-
image: The image identifier to display in the button. -
tooltip: The tooltip text to display when mouse hovers. -
script: The code being executed when the user clicks on the button.
loadImage
loadImage(filename)
Load an image file that can be used in the PrestoPlot user interface functions, like addToolbarButton.
Parameters :
filename: The image file name to convert (PNG, JPG, GIF).
Return : An identifier referencing the loaded image, that can be given to other functions.
showMessage
showMessage(title, message)
This function will simply display a message popup to the user. The code execution is suspended until the user closes the dialog.
Parameters :
-
title: The title of the displayed message. -
message: A message to be displayed to the user.