Commit b2e81c0b authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

fix the submenu example to make it work properly once installed. Patch by

2009-03-21  Cosimo Cecchi  <cosimoc@gnome.org>

	* examples/submenu.py: fix the submenu example to make it work
	properly once installed.
	Patch by Bruce van der Kooji (#559172).

svn path=/trunk/; revision=61
parent 51128532
2009-03-21 Cosimo Cecchi <cosimoc@gnome.org>
* examples/submenu.py: fix the submenu example to make it work
properly once installed.
Patch by Bruce van der Kooji (#559172).
=== 0.5.1 ===
2008-09-16 Johan Dahlin <johan@gnome.org>
......
import nautilus
class ExampleMenuProvider(nautilus.MenuProvider):
# Nautilus crashes if a plugin doesn't implement the __init__ method.
# See Bug #374958
def __init__(self):
pass
def get_file_items(self, window, files):
menuitem = nautilus.MenuItem('ExampleMenuProvider::Foo', 'Foo', '')
top_menuitem = nautilus.MenuItem('ExampleMenuProvider::Foo', 'Foo', '')
submenu = nautilus.Menu()
menuitem.set_submenu(submenu)
top_menuitem.set_submenu(submenu)
menuitem = nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', '')
submenu.append_item(menuitem)
sub_menuitem = nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', '')
submenu.append_item(sub_menuitem)
return menuitem,
return top_menuitem,
# FIXME: Why isn't this working?
def get_background_items(self, window, file):
submenu = nautilus.Menu()
submenu.append_item(nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', ''))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment