Source code for sas.sasgui.guiframe.dummyapp
"""
Dummy application.
Allows the user to set an external data manager
"""
from __future__ import print_function
import sas.sasgui.guiframe.gui_manager as gui_manager
from sas.sasgui.guiframe.plugin_base import PluginBase
[docs]class DummyView(gui_manager.SasViewApp):
"""
"""
[docs]class TestPlugin(PluginBase):
[docs] def get_panels(self, parent):
"""
Create and return the list of wx.Panels for your plug-in.
Define the plug-in perspective.
Panels should inherit from DefaultPanel defined below,
or should present the same interface. They must define
"window_caption" and "window_name".
:param parent: parent window
:return: list of panels
"""
## Save a reference to the parent
self.parent = parent
# Define a panel
defaultpanel = gui_manager.DefaultPanel(self.parent, -1)
defaultpanel.window_name = "Test"
# If needed, add its name to the perspective list
self.perspective = [defaultpanel.window_name]
# Return the list of panels
return [defaultpanel]
[docs]class SasView():
def __init__(self):
"""
Initialization
"""
self.gui = DummyView(0)
fitting_plug = TestPlugin()
self.gui.add_perspective(fitting_plug)
# Build the GUI
self.gui.build_gui()
# Set the application manager for the GUI
self.gui.set_manager(self)
# Start the main loop
self.gui.MainLoop()
if __name__ == "__main__":
from multiprocessing import freeze_support
freeze_support()
sasview = SasView()