Repository navigation
Using the Python Scripting Interface
MPRUN provides a powerful Python Scripting Interface (PSI) to interact with its internal application functions.
Warning
Having a good understanding of the Python programming language is essential if you want to really take advantage of the PSI. It’s okay if you don’t know Python though, as you can still download other people’s Python scripts.
You can access MPRUN’s types and objects simply by inputting mprun and using the access modifier .
All GUI is written in PyQt, so a knowledge of the Qt framework can really help cr
MPRUN has types for accessing GUI widgets and functions, here is a full list:
-
mprun.panel_container: the right QToolBox containing all panels (properties panel, libraries panel, etc.) -
mprun.toolbar: the left QToolBar containing all tool button QActions (select tool, pan tool, etc.) -
mprun.edit_toolbarthe top QToolBar containing edit button QActions (align tools, layer tools, etc.) -
mprun.menu_bar: the QMenuBar containing all sub menus (file, tools, etc.
After you have seen all types, you can start using them. Let’s create an example script:
# No need to import mprun, as it is executed at run time
my_widget = QPushButton(mprun, ‘This is a test’)
mprun.toolbar.addWidget(my_widget)This will create a button on the left toolbar that says “This is a test”
This is a place for people to solve issues, learn, or get developer advice related to MPRUN. You can also add more pages and documentation to this wiki by cloning it with https://github.com/ktechhydle/mprun_repo.wiki.git.