In addition, the main window has an appendTreeTab method that creates a new tab item in the tabbed area and returns a vertical frame into which you can add your widgets. If you want to simply add a tab after the Model and Results tabs, you can use appendTreeTab from within your custom code. However, if you want to change the order of the tabs or remove one of the standard tabs, you must derive your own toolset from the Tree toolset. For example: class MyTreeToolsetGui(TreeToolsetGui): def makeTabs(self): self.makeModelTab() self.makeMyTab() self.makeMaterialLibraryTab() self.makeResultsTab() def makeMyTab(self): vf = getAFXApp().getAFXMainWindow().appendTreeTab( 'My Tab', 'My Tab') FXLabel(vf, 'This is my tab item') The first argument to the appendTreeTab method is the text that you want to show up in the tab button. The second argument is the name of the tab, which is used for identification purposes in various application programming interfaces, such as setCurrentTreeTab(name). By default, when you create a tab it will be visible in all modules, and it will be applicable to all modules. If you do not want your tab to be visible or applicable to all modules, you can use the setApplicabilityForTreeTab and setVisibilityForTreeTab methods. When the user switches to a new module, the application will check to see if the current tab is visible in and applicable to the new module. If the tab is not visible, it will be hidden. If it is not applicable, the application will search for the first tab that is applicable to the new module and make that tab current. For example: def makeMyTab(self): vf = getAFXApp().getAFXMainWindow().appendTreeTab( 'My Tab', 'My Tab') getAFXApp().getAFXMainWindow().setApplicabilityForTreeTab( 'My Tab', 'Part, Property') getAFXApp().getAFXMainWindow().setVisibilityForTreeTab( 'My Tab', 'Part, Property') FXLabel(vf, 'This is my tab') In this case, when the user is in the Part module, My Tab will be shown. If the user clicks on My Tab to make it current and then switches to the Property module, My Tab will remain visible and current. If the user switches to the Step module, My Tab will be hidden and the Model tab will become current (because it has been defined as applicable to all modules except the Visualization module). |