TypeError: startView() takes exactly 1 argument (3 given)

R

Ron Croonenberg

Hello,

I am trying to write a plugin for Rhythmbox in python and run into a
'strange' problem. For a method (an action for clicking a button) I
started a method and however many arguments I use, it keeps giving me
the same error:

'TypeError: startView() takes exactly 1 argument (3 given)'

does someone have any pointers or tips?, thanks;

Ron

here is the code I have the problem with:

import rb
import pygtk
import gtk, gobject


pygtk.require('2.0')



class tb_button (rb.Plugin):

#
# the init thing
#
def __init__(self):
rb.Plugin.__init__(self)

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

view_button = """
<ui>
<toolbar name="ToolBar">
<placeholder name="View">
<toolitem name="View" action="viewAction">
</toolitem>
</placeholder>
</toolbar>
</ui>
"""

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

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

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



#
# Start the View
#
def startView(self, widget, shell, se):
# nothing yet
return
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top