Widget callbacks are rarely enough to support a full range of user interaction in a graphical interface. Action handlers are introduced, as well as the structuring of menus. Although the Athena widget set's support for menus is extremely rudimentary, it demonstrates how a gadget differs from a widget.
You should have read Chapter 8.1 and Chapter 13.1 - 13.2 in Nye and O'Reilly, Vol. 4, before starting this exercise.
Why must QuitAction() be added to the forward declarations for handlers at the beginning of the program?
What is the minimum number of translations needed so that the action will work regardless of whether the user types upper or lower case? Show them.
How would the performance have been affected if the call to XtCallCallbacks had used w (the widget where the event was detected) instead of quit_button?
HP Sun Menu Help Prev Alt Extend char Alt Graph Next F1What happens when you hold a key down instead of releasing it immediately?
How could you modify your popup to do this?
Does it interfere with the callbacks you have established for some of the widgets? Why or why not?
Have the action routine print a message indicating the x and y coordinates where the click occurs.
Are these measured in terms of the root window, or the window where the event occurred?
What factors would influence your decision to use buttons or menus in supporting interface features?
Remove the buttons, replacing them by a single MenuButton that offers access to the two features. The next step is to create a widget of type SimpleMenu, making it a child of the MenuButton. Then you add the menu items; for the first try, just add the Quit capability by creating a single item of SmeBSBObjectClass and hooking it to your callback routine.
How can you associate a keyboard shortcut with a menu item? How would you indicate to the user that the feature is available?
Suppose you had to code your own "popup menu" in the form of a popup box containing a button for each menu item. How many widgets, callbacks, and calls to Xt routines do you save by using SimpleMenu instead of building your own popup?