[Rhythmbox-devel] startView() takes exactly 1 argument (3 given)


I am (trying) to write a plugin for rhythmbox (in python) and keep running into an error msg from an action from the toolbar

I am adding a 'button' to the toolbar and when it's clicked execute a function/method.

I get a runtime error every time I click the button, here it is:
TypeError: startView() takes exactly 1 argument (3 given)
(It doesn't matter how many arguments I use in the function/method header, the same error-msg shows up.

I followed the outline in the rhythmbox plugins writing guide for adding 'an item'.

Here is the code snippet:

# the activate thing
def activate(self, shell):
self.shell = shell

view_button = """
  <toolbar name="ToolBar">
    <placeholder name="startView">
      <toolitem name="startView" action="viewAction">

# create a new action
action = gtk.Action('viewAction',
                  _('Start _View'),
                  _('Browse'), "")

# connect it
action.connect('activate', self.startView, shell)
action_group = gtk.ActionGroup('NewActionGroup')
shell.get_ui_manager().insert_action_group(action_ group)

# add it to the toolbar
ui_manager = shell.get_ui_manager()

# Start the View
def startView(self, b, c, d): # tried this with 1, 2, 3, 4, 5... args

any tips/hints ?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]