Whole document tree
The Applet's Context MenuWhen the user right clicks on the applet, a menu appears, this is all handeled by the panel, so in order to add items to it you use a special interface to "add callbacks" to the menu. A very simple example would be (making our hello applet even more feature full): Example 4. hello_applet with menu items
Now the user will see a "Hello There" menu item on the applet menu, and when selected, the applet will print "Hello There". Useful huh? Note that the second argument to the register_callback is just a string identifier of this callback, and can really be whatever you want. But it should NOT be translated as the label (the 3rd argument) should be. |