Wiki page
[vars] by
mario
2017-09-23 18:45:28.
D 2017-09-23T18:45:28.191
L vars
N text/x-markdown
P 060be498366ee2231c4e25ca4111ac6731ddb0dd
U mario
W 1593
Some notes on the used variables, and how they're shared between GUI and main runspace.
### $GUI
The $GUI hash exists in both the main thread as well as the WPF runspace.
It contains some widgets and an event queue:
* main widgets:
* $GUI.w == $GUI.Window
* $GUI.Menu
* $GUI.Ribbon (toolbar)
* $GUI.Output (the Powershell/main output window)
* $GUI.styles (WPF styles)
* Notebook tabs
* $GUI.Grid\_EXTRAS
- each other predefined notebook has a Grid\_CATEGORY widget, but no variable shortcut
- likewise there are predefined Menu\_CATEGORYs; but unlike Grid\_ entries, unknown categories will be auto-created (below the Extras menu)
* Input fields:
* $GUI.machine
* $GUI.username
* $GUI.bulkcsv
* $GUI.vars a workaround hash to extract above fields together with extra plugin fields (input boxes or dropdowns in toolbock area)
* $GUI.html collects output as well
* $GUI.tasks sends $menu entries to the main runspace, for execution by
Run-GuiTask that is
### main
* local vars $machine and $username get auto-created from the GUI fields.
* $cfg.* is a global array (copied into WPF thread) for settings and defaults
* $menu lists all plugins and their options (see [plugin meta data](wiki/plugin+meta+data))
* $e is often a single entry from $menu
* $plugins defines a few hooks to run before or after scripts (not quite finalized, type:init plugins usually register themselves)
* $shell is a reference to the WPF runspace
Z ee232b55f210533ec88e480860d71797