VBTKit menu

VBTKit has a replacement for MenuBntVBT called MenuSwitchVBT. These VBT's take a switch as a child and so switches can be used to make up menus just like the earlier example.

An AnchorBntVBT can be used to pop-up a menu just exactly as before. The values hfudge and vfudge are the horizontal and vertical offsets of the northwest corner of the popup menu relative to southwest corner of the anchor button. These values cannot be set when the anchor button is created. Therefore, a separate call is required to AnchorBtnVBT.Set. This call appears in the main body of the program Menu2.m3.

The following images:

show three views of the application while it is running. The application consists of a single anchor button. When pressed a two-item menu pops up (the second image). The user is given shadowed feedback when an item of the menu is pressed (the third image). Releasing the button causes the appropriate callback to be invoked and the pop-up menu to disappear.