LinuxDev.net: Writing Gnome Panel Applets II: Customizing The Applet-MenuMay 23, 2000, 14:48 (0 Talkback[s])
(Other stories by Daniel Solin)
[ Thanks to BeOpen for this link. ]
"In this second article of our series, "Writing GNOME Panel Applets", we will show you how to manipulate the special applet-menu that pops up if you right-click on an applet. Using the program we developed in the first article as the base, we will add a menu-item and connect it to a so-called callback function. This function will get executed each time you select its referring item from the menu. In the example used in this article, we will create a menu-item for showing an About dialog box."
"The applet-menu is the menu that pops up if you right-click on an applet. The standard applet-menu holds three items, labeled "Remove from panel", "Move" and "Panel." The functions of the first two are obvious; you use them if you want to delete the applet or move it to a different location on the panel. The third item, "Panel", holds a large set of sub-menus, from which you can perform various panel operations."
"n this article, we want to extend the standard menu of three items with additional items, that we have defined. Fortunately, this is very easy. In fact, all you have to do is to call the applet_widget_register_callback() function for each item you want to add."