awvInitWindowFunctionAdd
awvInitWindowFunctionAdd(u_function) =>t/nil
Description
Adds a function to the list of initialization functions that are called when a new Waveform window is opened.
The list of functions is empty by default. For example, you can use this function to add menus to every new Waveform window that is opened.
Arguments
Value Returned
Examples
The following example adds a procedure myCreateMenu, which creates a new banner menu Test in the Results Browser. The Test menu has two options, Item1 and Item2.
-
When you click Item1, the message "
Item 1 Selected" is printed in the CIW. -
When you click Item2, the message "
Item 2 Selected" is printed in the CIW.
myCreateMenu
=> t
windowId=awvGetHiWindow(awvGetCurrentWindow())
procedure(
myCreateMenu(windowId)
win=awvGetHiWindow(windowId)
let((item1 item2)
item1=hiCreateMenuItem(
?name 'item1
?itemText "Item1"
?callback "println(\"Item 1 Selected\")"
)
item2=hiCreateMenuItem(
?name 'item2
?itemText "Item2"
?callback "println(\"Item 2 Selected\")"
)
hiCreatePulldownMenu( 'myMenu "Test" list(item1 item2))
hiInsertBannerMenu(win myMenu hiGetNumMenus(win))
)
)
awvInitWindowFunctionAdd('myCreateMenu)
=> myCreateMenu
=> t

The following message is printed in CIW when you click Item1 from the Test menu.
println("Item 1 Selected")
"Item 1 Selected"
The following message is printed in CIW when you click Item2 from the Test menu.
println("Item 2 Selected")
"Item 2 Selected"
Return to top