16.5 Summary
Menus are basically simple objects that provide the user with access to application functionality. While the simple
menu creation routines are handy for basic prototyping and other simple application constructs, their usefulness is
limited once you begin to develop larger−scale applications.
We have described the design of a general menu creation routine, so it should be clear that you only need two things
to create an arbitrary number of menus: predefined arrays of MenuItem structures and the BuildMenu() function.
Since initializing an array of MenuItem objects is very simple, our method is convenient and also more powerful
than the simple menu creation routines. We have defined our own data type and generalized the routine to build
menus so that you can use and modify these functions however you like, to conform to the needs of your application.
16.6 Exercises
This chapter could go on forever discussing more and more things you can do with menus. However, the goal was to
present you with the fundamental concepts and design considerations behind menus. From this information, you
should be able to teach yourself new techniques that we haven't touched upon. In that spirit, you should be able to do
the following exercises based on the material covered in this chapter.
Create a MainWindow widget that has a MenuBar that contains at least the File, Edit, and Help menus, an
OptionMenu, and a PopupMenu that pops up from a DrawingArea widget. First implement the menus using
the simple ...