This section illustrates a complete pop-up menu sample program. The source
code for a sample Hello application is provided here to demonstrate how
to customize a Workplace Shell pop-up menu. The application creates a new
class, Hello, from the WPDataFile class with a modified pop-up menu, and
then creates an instance of the new class called MyHello. An instance of
the Hello class will be just like a WPDataFile object with the following
exceptions:
- The Open submenu will have a Say Hello item.
MyHello's primary menu will have a Message Box item. The context
menu will have the Move item removed. The following figure shows
MyHello object and its pop-up menu:
- Selecting the Open Say Hello item or double
clicking on the object will cause a window to display the text "Hello, Workplace
Shell.", as shown in the following figure:
- Double clicking on the Message Box item will
display a message box with information about this example, as shown in the
following figure:
[Back]
[Next]