# Import the GNOME applet routines: import gnome.applet # Import the Gtk+ routines: import gtk # The main() function: def main(): # Create an instance of the AppletWidget class: myapplet = gnome.applet.AppletWidget("Simple Applet") # Create a label to show be shown inside the applet: label = gtk.GtkLabel("O'Reilly") # Create a frame: frame = gtk.GtkFrame() # Add the label to the frame: frame.add(label) # Show the label: label.show() # Show the frame: frame.show() # Add the frame to the applet: myapplet.add(frame) # Set the tooltip text for the applet: myapplet.set_tooltip("This is a very simple panel applet.") # Show the applet: myapplet.show() # Get into the Gtk main-loop: gtk.mainloop() # This is plain old Python, so you should understand this: if __name__ == '__main__': main()