Hi,

In my current code, when the user highlights an item in a combo box, the index gets passed to a function like so below:

self.tab2TrajectoryCombo.highlighted.connect(self. trajectorychanged)
.
.
.
def trajectorychanged(self, value):
'''trajectory changed'''

self.pcgraphs.changetrajectory(int(str(value)))
self.tab2TrajectoryCombo.setCurrentIndex(int(str(v alue)))
self.tab3TrajectoryCombo.setCurrentIndex(int(str(v alue)))

The above works nicely. However, I want to pass an argument to the function in addition to the index from the combobox. So I would do something like:

self.tab2TrajectoryCombo.highlighted.connect(lambd a: self.trajectorychanged(2))
.
.
.
def trajectorychanged(self, value, numbertwo):
'''trajectory changed'''

self.pcgraphs.changetrajectory(int(str(value)))
self.tab2TrajectoryCombo.setCurrentIndex(numbertwo )
self.tab3TrajectoryCombo.setCurrentIndex(numbertwo )

The above code doesn't work though. The error is:

Traceback (most recent call last):
File "/users/gareths/workspace/pyPczplotGUINew/tabwidget.py", line 55, in <lambda>
self.tab2TrajectoryCombo.highlighted.connect(lambd a: self.trajectorychanged(2))
TypeError: trajectorychanged() takes exactly 3 arguments (2 given)

Does anyone know how to do this?

Many thanks in advance