The child class includes several "manditory" method as well as any other methods it needs. It doesn't have to have both the Processing and Visualation Panes as seen in the difference between BioFEM and BioTensor. Below are descriptions of the different components of a PowerApp child class.
Files such as Module.tcl make calls to PowerApp methods when their state is updated, they are dynamically compling, or an error is recieved. Therefore, each PowerApp must have certain methods to handle these situations. In addition, every PowerApp must handle loading and saving and displaying help and an about box. The following are manditory methods to have in a PowerApp child class:
- constructor {} to initialize variables and define tooltips
- appname {} - method that returns the name of the app
- save_session {} - method to handle saving a session
- load_session {} - method to handle loading a saved session
- show_help {} - method to display the help information
- show_about {} - method to display about information
- indicate_dynamic_compile {which mode} - method to change the indicator and labels when dynamic compilation begins and ends
- update_progress {which state} - method to catch module update_state calls and change the progress bar and labels accordingly
- indicate_error {which msg_state} - method to indicate an error or reset an error
- change_indicate_val {val} - method to change the indicate val and change labels appropriately
- change_indicator_labels {msg} - method to change indicator labels and handle changing labels when loading a session.
Below are several "suggested" methods that will help make keeping track of the state easeir.
- build_app {} - method to construct your app. This will build both Panes and any tabs contained in them.
- initialize_blocks {} - method to disable any modules to enforce the step-by-step functionality
- setColor {col color mode} - method only when giving a colormap selection choice
- build_step_tab {f} - for each step. This should take a frame and should be called for the attached and detached Panes.
- execute_step {} - method to execute each processing step
- configure_tabname_tabs {} - method to configure both the attached and detached tab given by tabname
- toggle_option - methods for each checkbutton or radiobutton that enables or disables gui widgets
- init_Pframe {f} - method to build Processing Pane on a specified frame
- init_Vframe {f} - method to build Visualization Pane on a specified frame
- switch_P_frames - method to handle the attaching and detaching of the Processing Panes
- switch_V_frames - method to handle the attaching and detaching of the Visualization Panes
To help maintain state during executing and when loading a saved session, there are several suggested variables regarding which tab is visible and which guis are disabled.
There should be two variables for every tabnotebook widget so that when a tab is selected on the attached frame, the corresponding tab can be selected on the detached frame. There should also be a variable for each tabnotebook indicating which tab is currently visible.