instant gtop launch from cpumemusage-applet




I have added a right-click entry to the cpumemusage applet called "Launch
gtop", which does what it says, it's intended as a shortcut to gtop

What do you think?
 Of course ther'es the entry in the Utilities section of the gnome-menu
(um, is it called that way?), but i think a shorcut from the applet
wouldn't hurt...

--- cpumemusage.c.old	Wed May 27 22:15:07 1998
+++ cpumemusage.c	Wed May 27 22:13:55 1998
@@ -93,9 +93,16 @@
 	return vbox;
 }
 
+static void
+launch_gtop(AppletWidget *applet, gpointer data)
+{
+	system("gtop");
+}
+
 int main(int argc, char **argv)
 {
 	GtkWidget *applet;
+	GtkWidget *gtop_launch;
 
         applet_widget_init_defaults("cpumemusage_applet", NULL, argc, argv, 0,
 				    NULL, argv[0]);
@@ -107,6 +114,13 @@
         cpumemusage = cpumemusage_widget();
         applet_widget_add( APPLET_WIDGET(applet), cpumemusage );
         gtk_widget_show(applet);
+	
+	/* add launch_gtop item to the applet menu */
+	applet_widget_register_callback(APPLET_WIDGET(applet),
+					"gtop",
+					_("Launch gtop"),
+					launch_gtop,
+					NULL);
 	
 	applet_widget_gtk_main();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]