Hi there
I have the default context menu and I want to add additional menus and
actions to it e.g.
Menu
- Menu 1
- action 1
- Menu 2
- action 2
I have created this inside a for loop. The problem is when I click on the
"action 1", it has the properties of "action 2". Here is a simplified
section of my code
for k in range(0,2):
tmp = plt.menu.actions()
are = tmp[7].menu()
tmp_a = are.actions()
ars = are.addMenu(title[k])
if k == 0:
tmp = QtGui.QAction(info, ars, checkable=True)
else:
tmp = QtGui.QAction(info, ars, checkable=False)
ars.addAction(tmp)
ars.triggered.connect(lambda: self.F(self, ars))
def self.F(self, ars)
ars ... checkable = False
When I click on the "action 1" or "action 2" button, inside the self.F
function it always has checkable= False. I think somehow the actions are
linked somehow. Can someone explain this to me please and if possible how
can I break this link
Thanks for your help
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/cd1d5984-fd43-4b21-aa02-bae04be49179%40googlegroups.com.