GNOME is a popular Desktop environment for Linux and Unix like operating systems. The following sections will explain how to integrate you application into the application menus, also known as start menus. In later posts I will explain how opensource code is managed and how it is packaged and shipped with Ubuntu and Redhat Linux distributions.
Development
The GNOME Desktop is based on the Gtk+ graphical toolkit to draw windows and widgets. Gtk+ has its roots in the GIMP project, providing a full featured graphics and image manipulation program. For that reason Gtk+ stands for The GIMP toolkit. Arround Gtk+ the GNOME project developed services and features, implementing a rich but simple to use Desktop environment, standardizing interfaces and services, such as printing, event management, etc.
The core libraries of GNOME and Gtk+ have been implemented in C for performance reasons and to allow easy interfacing from all kinds of environments and programming languages. Therefor you may choose from all kinds of programming languages to implement an application for the GNOME Desktop, such as C, C++, C#, Java, Python, and Perl, just to mention the most popular ones.
In contrast, the KDE project is based on the Qt library (say “cutie”), and the whole project is based on C++.
Developing a GNOME application I recommend the interpreted language Python, combined with GtkBuilder feature, formerly known as Glade. The GtkBuilder features allows to create the GUI with Interface Builder Glade Interface Designer, being stored as declerative XML file. The Python application just needs to invoke the GtkBuilder to read the file, build teh GUI and bind event handlers to the events and widgets. This allows a strict separation of GUI development and application logics. GUI events will be delegated to application logic/functions using callbacks which have been connected to before.
Compared to C the programming language Python allows more rapid development to bring your prototype to the street. The drawback of Python is the weak runtime type-checking which demands more discipline of the programmer.
Micah Carrick published an excellent Gtk and Glade tutorial explaining also usage with Python programming language.
Once you are done with your application,and ship it as package to users, you want it to show up in the system wide GNOME or KDE application menus after installation, such as for the Cheese webcam application shown here
Application Menu Description
The menu entries allow a comfortable start of your application via the GNOME Application Menus. The entries can be registered at a central location for all users or per user via configuration files.
A single file holds the description of the menu entry. System wide this file is placed in the directory /usr/share/applications/. The following file demonstrates a menu entry for the webcam tool cheese being shipped with Ubuntu Linux distribution. The original file has been simplified for better understanding. For example the long list of fullname translations has been shortened.
1: # File /usr/share/applications/cheese.desktop 2: [Desktop Entry] 3: Name=Cheese 4: X-GNOME-FullName=Cheese Webcam Booth 5: X-GNOME-FullName[de]=Cheese Webcam-Automat 6: X-GNOME-FullName[es]=Fotomatón de cámara web Cheese 7: Comment=Take photos and videos with your webcam, with fun graphical effects 8: Exec=cheese 9: Terminal=false 10: Type=Application 11: StartupNotify=true 12: Icon=cheese 13: Categories=GNOME;AudioVideo; 14: X-GNOME-Bugzilla-Bugzilla=GNOME 15: X-GNOME-Bugzilla-Product=cheese 16: X-GNOME-Bugzilla-Component=general 17: X-GNOME-Bugzilla-Version=2.28.1 18: X-GNOME-Bugzilla-ExtraInfoScript=/usr/lib/cheese/cheese/cheese-bugreport.sh 19: X-Ubuntu-Gettext-Domain=cheese
Any time you place a new file in that specific directory, the GNOME Menu of all useser will be updated immediatly. The given file declares a number of attributes being explained here.
The file starts with a comment in line 1. Commenting lines can be placed anywhere in the file. The following line [Desktop Entry] declares the start of the menu description section. This style comes from times before XML became popular.
Most attributes are self explaining, but some are worth to look closer at.
Line 3: Name=Cheese defines the short name of the application being showed in menu tray.
Line 8: Exec=cheese declares the executable to be started in case the menu entry is selected. The file is searched for along the paths declared by PATH environment variable.
Line 8: Terminal=false defines that this application does not require a terminal window to be executed in. If the application does not open its own window, but expects a shell-terminal environment, this attribute must be set to true.
Line 9: Type=Application defines that this is a reference to an application. In case the menu entry is a weblink the type will be Link.
Line 12: Icon=cheese declares the icon being displayed in the menu entry. By default the icon is searched for in the system wide icon directory, so that the full name expaned will be /usr/share/icons/hicolor/48×48/apps/cheese.png.
The portable network graphics format (PNG) had been developed as replacement for GIF to get around patent issues.
Line 13: Categories=GNOME;AudioVideo; declares the menu folder the entry will be placed in. A number of categories have been predefined, an extended list of currently used categories is added as appendix.
Application categories
You have got to choose a category for your application. Files of the same category will be grouped into the same application menu subfolder for seclection. The following is a list of categories of Linux desktop application being used currently. The list is incomplete,it reflects more the kind of applications installed on my system. The GNOME Desktop may group similar categories so that they may appear in the same menu folder.
The list is quite extensive. If you have got to choose one of the categories, my advice is first to choose the menu folder it should appear in, and then to look which categories the corresponding applications belong to. If your application is not GNOME specific, you should choose one of the more general ones, such as Application;Utility; if it is an utility.
Application;Development;Application;Network;Application;Office;Database;Application;Office;Math;Application;Office;Presentation;Application;Office;Spreadsheet;Application;Office;WordProcessor;Application;System;Application;System;Settings;Application;Utility;Application;Utility;TextEditor;AudioVideo;AudioVideo;Audio;AudioVideoEditing;AudioVideo;GTK;Player;TV;Core;Debugger;Development;GNOME;Profiling;Development;Development;ProjectManagement;Development;RevisionControl;Documentation;Development;Education;Emulator;Utility;Game;ArcadeGame;GNOME;Application;Core;GNOME;Application;Development;GNOME;Application;Network;GNOME;AudioVideo;GNOME;AudioVideo;DiscBurning;GNOME;Core;System;GNOME;Game;BoardGame;GNOME;GTK;GNOME;GTK;Accessibility;X-GNOME-PersonalSettings;GNOME;GTK;AudioVideo;GNOME;GTK;AudioVideo;Audio;Recorder;GNOME;GTK;Core;GNOME;GTK;Core;Documentation;GNOME;GTK;Development;IDE;GNOME;GTK;Game;ArcadeGame;GNOME;GTK;Game;BlocksGame;GNOME;GTK;Game;BoardGame;GNOME;GTK;Game;CardGame;GNOME;GTK;Game;LogicGame;GNOME;GTK;Graphics;RasterGraphics;Viewer;GNOME;GTK;Graphics;VectorGraphics;Viewer;GNOME;GTK;Network;InstantMessaging;GNOME;GTK;Network;RemoteAccess;GNOME;GTK;Network;Telephony;GNOME;GTK;Office;Dictionary;GNOME;GTK;Office;Email;Calendar;ContactManagement;X-Red-Hat-Base;GNOME;GTK;Security;Utility;GNOME;GTK;Settings;GNOME;GTK;Settings;DesktopSettings;GNOME;GTK;Settings;HardwareSettings;GNOME;GTK;Settings;System;GNOME;GTK;Settings;X-GNOME-NetworkSettings;GNOME;GTK;Settings;X-GNOME-PersonalSettings;GNOME;GTK;Settings;X-SuSE-ControlCenter-System;X-GNOME-NetworkSettings;GNOME;GTK;System;GNOME;GTK;System;Settings;GNOME;GTK;System;Settings;HardwareSettings;GNOME;GTK;System;Settings;Monitor;GNOME;GTK;System;Settings;X-GNOME-NetworkSettings;GNOME;GTK;System;Utility;Core;GNOME;GTK;Utility;GNOME;GTK;Utility;CalculatorGNOME;GTK;Utility;Core;GNOME;GTK;Utility;TerminalEmulator;GNOME;GTK;Utility;TextEditor;GNOME;Network;GNOME;Office;X-Red-Hat-Base;GNOME;Settings;DesktopSettings;GNOME;System;Filesystem;Settings;Graphics;2DGraphics;RasterGraphics;GTK;Graphics;Photography;GNOME;GTK;Graphics;VectorGraphics;Graphics;VectorGraphics;GTK;GTK;AudioVideo;Audio;Video;Player;TV;GTK;GNOME;Application;System;Settings;GTK;GNOME;AudioVideo;Player;Video;GTK;GNOME;Settings;DesktopSettings;GTK;GNOME;Settings;HardwareSettings;GTK;GNOME;Settings;X-GNOME-PersonalSettings;GTK;GNOME;System;Monitor;Settings;GTK;GNOME;Utility;GTK;GNOME;Utility;Accessibility;GTK;GNOME;Utility;Archiving;Compression;GTK;GNOME;X-GNOME-NetworkSettings;Network;GTK;Graphics;RasterGraphics;Scanning;OCR;GTK;HardwareSettings;Settings;GTK;Monitor;Utility;GTK;Network;TrayIcon;GTK;Printing;HardwareSettings;Settings;System;GTK;Utility;Network;Network;Application;Network;FileTransfer;P2P;GTK;Network;InstantMessaging;PackageManager;GTK;System;Settings;PackageManager;System;Profiling;Development;Qt;Development;RevisionControl;Settings;Settings;X-GNOME-PersonalSettings;Settings;X-GNOME-SystemSettings;System;System;Settings;System;Settings;GNOME;GTK;System;Settings;GTK;HardwareSettings;System;Settings;PackageManager;GTK;X-nxclient;
This List has been created using the command sequence
grep -h Categories /usr/share/applications/* |sort | uniq | sed 's/Categories=//g'
Various categories may share the same groupe in the GNOME Menus, such as the office applications. The user may define a new category, but is is recommended to choose one of the predefined categories.
Tags: Linux GNOME Apps Menu

May 11, 2010 at 4:11 am |
sir,i have created a client server socket programm in fedra core 8 using c language.
all i need is i want a window with two buttons one for client side and other for server side so that if i click on respective buttons it has to link to the terminal so that i can run the respective programm.
please hep me.
thanks in advance,
Gagan
May 16, 2010 at 11:32 pm |
Hi Gagan,
I am not sure I understand what you want. The simplest way is to use the GtkBuilder. The following pages explain how to create a GUI and integrate it with GtkBuilder into your C or Python Apps:
http://www.micahcarrick.com/12-24-2007/gtk-glade-tutorial-part-1.htm
Does this help?
Frank