Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:howto:panel-plugins [2008/02/17 14:23] – created - added hello-world example from goodies-dev m/l stephandev:howto:panel-plugins [2008/02/17 14:31] (current) – removed stephan
Line 1: Line 1:
-====== Creating Panel Plugins ====== 
-There are several ways to write a panel-plugin for the xfce4-panel. 
  
-===== Examples ===== 
- 
-==== C-code Example ==== 
- 
-==== Python (PyXfce) Example ==== 
- 
-  # Hello World example 
-  # External libraries 
-  import gtk                                      # use gtk-library 
-  import xfce4.panel                              # to create xfce4 panel plugin 
-   
-  # Button with status icon and menu plopping up on clicking it 
-  button = gtk.Button( "Hello World" ) 
-  button.show() 
-   
-  # create an xfce panel plugin 
-  plugin = xfce4.panel.Plugin() 
-   
-  plugin.add( button ) 
-   
-  # Add right mouse button action 
-  plugin.add_action_widget( button ) 
-   
-  # Show plugin 
-  plugin.show() 
-   
-  # Close plugin on destroy 
-  plugin.connect("destroy", pynm.stop ) 
-   
-  # Ready. Start plugin 
-  gtk.main_loop()