[Goodies-dev] [request] python plugin tutorial

Martin Forsgren mk0foma at student.chalmers.se
Wed Jan 30 20:55:04 CET 2008


Hi,

there isn't much documentation, atleast what I've found, but
its not so hard. Check http://code.google.com/p/pynetworkmanager/ and look
at the panel-plugin code.

Maby this below is enough for you... (it's copy/paste code and can contain  
errors)

------

# 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()

---------

Den 2008-01-25 18:44:59 skrev Alexandre Leray  
<newsletters at alexandreleray.com>:

> Hi everybody,
>
> It's quite hard to find documentation on pyxfce and python plugins. Does
> anybody could make me a brief tutorial (like "hello world" in a panel)
> or give me links for?
>
> Thanks!
> _______________________________________________
> Goodies-dev mailing list
> Goodies-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/goodies-dev





More information about the Goodies-dev mailing list