I have several questions related to assistants, toolbars, and actions.
1) I've figured out how to create a toolbar and also a dockable window. Is there a way to add those to the list of choices I see when I right click to the right of the "Help" menu choice in virtuoso? I get the normal popup with choices "assistants" and "toolbars".
2) I have some code which generates a toolbar that has a "category" combo box and then based on which category is picked the toolbar gets populated with a bunch of actions. This seems to be working as desired. In the callback for that combo, I use hiDeleteToolBarItem to remove the old list of actions and hiAddToolbarItems add the new ones.
Unfortunately, I think that is is actually a dockable window I ultimately want instead of a toolbar because I wanted to have a tab for it like my other docked assistants (Palette, Navigator, Annotation Browser). I tried adding the toolbar to a dockable window I created but it is pretty easy to accidentally drag the toolbar out of that dockable window and then I can't get it to stick back in so I think that isn't really the right approach.
Should I be using my actions (created with hiCreateAction) and adding them to a fixed menu that I put in the dockable window?
In case someone else is looking for code samples:
;; creating a simple dockable window
formId = hiCreateAppForm(
?name 'myAppForm
?fields list(
hiCreateLabel( ?name 'label1 ?labelText "My Label" )
hiCreateButton(?name 'button1 ?buttonText "My Button" ?callback "printf(\"button 1 callback\n\")")
hiCreateComboField(?name 'combo1 ?prompt "My Combo" ?items list("choice1" "choice2" "choice2"))
)
)
winId = hiCreateDockWindow(
?appType "layout"
?widgetType "form"
?handle 'myDockWin
?form formId
?scrollBar t
?title "My Dock Window"
)
mainSession = getCurrentWindow()->sessionWindow
hiDockWindow(?window winId ?session mainSession ?side 'left)
;; How to cause the dockable window to be tabbed like my other assistants (like Navigator, Palette, and Annotation Browser) already are?
;; how to add to the list of assistants in the popup menu that shows other assistants? Or do I just need to add something to a custom pulldown menu that is added to the banner that toggles my dockable window mapped/unmapped
;; create some actions
act1 = hiCreateAction(?name 'act1 ?iconText "Action 1" ?callback "printf(\"action 1\n\")")
act2 = hiCreateAction(?name 'act2 ?iconText "Action 2" ?callback "printf(\"action 2\n\")")
;; create a toolbar
toolbar = hiCreateToolbar(?name 'mytoolbar ?title "My Toolbar" ?toolButtonStyle 'textOnly)
hiAddToolbarItem(toolbar, act1)
hiAddToolbarItem(toolbar, act2)
w=getCurrentWindow()
hiPlaceToolbar(w, toolbar, 'left)
;; how to add to the popup menu list of toolbars?
;; can my actions be placed into the form in the dockable window instead of a toolbar?