- Das Menu heißt: cm_base
- Die Zwei Einträge: ps1 und p_c
- Die Combobox: chooser
Code: Alles auswählen
def base_menu(self, event, text):
if event.button == 1:
self.cm_base.popup(None, None, None, event.button, event.time)
self.text = text
def ps1(ps1, event):
if event.button == 1:
prompt_add(self, "ps1", self.text)
self.text = ""
self.ps1.connect("button-press-event", ps1)
def p_c(p_c, event):
if event.button == 1:
prompt_add(self, "pc", self.text)
self.text = ""
self.p_c.connect("button-press-event", p_c)
self.chooser.set_active(0)
def chooser(chooser, event):
if event.button == 1:
position = chooser.get_active()
if position == 1:
text = "\\$(count_files +f)"
elif position == 2:
text = "\\$(count_files -f)"
if position != 0:
print "%s" % text
base_menu(self, event, text)
self.countfiles.chooser("button-press-event", chooser)
Danke im Vorraus.