79. gui.menus.File
— Functions from the File menu.¶
79.1. Functions defined in module gui.menus.File¶
- gui.menus.File.openScript(fn=None, exist=False, create=False)[source]¶
Open a pyFormex script and set it as the current script.
If no filename is specified, a file selection dialog is started to select an existing script, or allow to create a new file if exist is False.
If the file exists and is a pyFormex script, it is set ready to execute.
If the file is empty or create is True, a default pyFormex script template will be written to the file, overwriting the contents if the file existed. Then, the script is loaded into the editor.
- gui.menus.File.editApp(appname=None)[source]¶
Edit an application source file.
If no appname is specified, the current application is used.
This loads the application module, gets its file name, and if it is a source file or the the corresponding source file exists, that file is loaded into the editor.
- gui.menus.File.saveImage(multi=False)[source]¶
Save an image to file.
Show the Save Image dialog, with the multisave mode checked if multi = True. Then, depending on the user’s selection, either:
save the current Canvas/Window to file
start the multisave/autosave mode
do nothing
- gui.menus.File.saveIcon()[source]¶
Save an image as icon.
This will show the Save Image dialog, with the multisave mode off and asking for an icon file name. Then save the current rendering to that file.
- gui.menus.File.exportWebGL()[source]¶
Export the current scene to WebGL
The user is asked for a file name to store the exported model, and after export, whether to load the model in the browser.