fusion_addin_framework.FusionAddin¶
- class fusion_addin_framework.FusionAddin(debugToUi: bool = True)¶
Entry point to create all your elements that will appear in the user interface.
Handles the creation of UI elements and deletes them (by calling the stop method).
- Parameters
debug_to_ui (bool, optional) – Flag indicating if erorr messages caused by errors in the eventhandlers are displayed in a messageBox or not. Regardless of this flag all messages will get logged by the module logger. Defaults to True.
- workspace(*args, **kwargs)¶
Creates a
Workspaceas a child of this Adddin.Calling this method is the same as initialsing a
Workspacewith this addin instance as parent parameters. Therfore the same parameters are passed. SeeWorkspacefor a detailed description of the paramters.- Returns
The newly created or accessed Workspace instance.
- Return type
- stop()¶
Stops the addin and deletes all created command and user interface related elements.
This methods needs to get called from the stop(context) function of the main file of your addin to ensure proper cleanup. If you dont call it, strange thigs can happen the next time you run the addin.
- registerElement(elem: fusion_addin_framework.wrapper._FusionWrapper, level: int = 0)¶
Registers an instance of a
_FusionWrapperto the addin.All wrapper objects that are registered will get deleted if the addin stops. The order of the deletion is determind by the level. Instances with a higher level will get deleted first. All elements that are created will be registered by the framework internally, so THERE IS NO NEED TO USE THIS METHOD in noraml use of the framework.
- Parameters
elem (_FusionWrapper) – The wrapper instance to register.
level (int, optional) – The Ui level of the element. Defaults to 0.
- property debugToUi: bool¶
Flag indicating if erorr messages are displayed in a messageBox or only send to the module logger.
- Type
bool
- property uiLevel: int¶
The ui level ot the app. (Always 0)
- Type
int
- property addin¶
Itself. Kept for consistency with the other wrapper classes.
- Type
FusionApp
- property createdElements¶
A dictonary with all the created ui elemnts mapped by their ui level.
- Type
Dict[int, List[FusionApp]]
Summary¶
Methods
|
Registers an instance of a |
|
Stops the addin and deletes all created command and user interface related elements. |
|
Creates a |
Attributes
Itself. |
|
A dictonary with all the created ui elemnts mapped by their ui level. |
|
Flag indicating if erorr messages are displayed in a messageBox or only send to the module logger. |
|
The ui level ot the app. |