After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 364248 - Can't create a submenu for nautilus.MenuItem
Can't create a submenu for nautilus.MenuItem
Status: RESOLVED DUPLICATE of bug 341579
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-10-22 18:53 UTC by Jon Dufresne
Modified: 2008-06-26 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jon Dufresne 2006-10-22 18:53:39 UTC
I want to create an extension that addes a menu item to the context menu of a file. I want to give this menu a submenu, but the current API won't allow this. Here is a simple example that gave me this error

import pygtk
pygtk.require('2.0')
import gtk
import nautilus

class ExampleExtension(nautilus.MenuProvider):
	def __init__(self):
		return
		
	def get_file_items(self, window, file):
		item = nautilus.MenuItem('NautilusPython::example_file_item', 'Example', 'Example tip')
		item.set_submenu(gtk.Menu())		
		return item,


And the error returned is

    item.set_submenu(gtk.Menu())
AttributeError: 'nautilus.MenuItem' object has no attribute 'set_submenu'

This makes sense, as set_submenu must not be implemented in the nautilus package, however, I feel it should be provided and would be useful for my extension.
Comment 1 Johan (not receiving bugmail) Dahlin 2006-10-22 19:02:23 UTC
Moving to nautilus component, probably a dup but I couldn't find one.
Comment 2 Nelson Benitez 2008-06-26 12:50:25 UTC
This is dup of bug 314579
Comment 3 Cosimo Cecchi 2008-06-26 12:58:37 UTC
Thanks Nelson, closing as such.

*** This bug has been marked as a duplicate of 341579 ***