Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/python
import etk
# Combobox
combo = etk.Combobox(columns=[
(etk.Combobox.IMAGE, 50, etk.Combobox.FILL, 0.0),
(etk.Combobox.LABEL, 50, etk.Combobox.FILL, 1.0),
(etk.Combobox.OTHER, 20, etk.Combobox.FILL, 0.0)])
combo.items_height = 50
def show(b, text):
print text
for i, v in enumerate(["XXX", "ABCABC", "P", "JJJJJ"]):
f = etk.Image()
f.set_from_file('07-image/icon.png')
b = etk.Button(label="?")
b.on_clicked(show, "I don't know what is %s" % v)
combo.item_append(f, v, b)
def show_item(c, i):
#!/usr/bin/python
import etk
# Combobox
combo = etk.Combobox(columns=[
(etk.Combobox.IMAGE, 50, etk.Combobox.FILL, 0.0),
(etk.Combobox.LABEL, 50, etk.Combobox.FILL, 1.0),
(etk.Combobox.OTHER, 20, etk.Combobox.FILL, 0.0)])
combo.items_height = 50
def show(b, text):
print text
for i, v in enumerate(["XXX", "ABCABC", "P", "JJJJJ"]):
f = etk.Image()
f.set_from_file('07-image/icon.png')
b = etk.Button(label="?")
b.on_clicked(show, "I don't know what is %s" % v)
combo.item_append(f, v, b)
def show_item(c, i):
print i.field_get(1)
combo.on_item_activated(show_item)
#!/usr/bin/python
import etk
# Combobox
combo = etk.Combobox(columns=[
(etk.Combobox.IMAGE, 50, etk.Combobox.FILL, 0.0),
(etk.Combobox.LABEL, 50, etk.Combobox.FILL, 1.0),
(etk.Combobox.OTHER, 20, etk.Combobox.FILL, 0.0)])
combo.items_height = 50
def show(b, text):
print text
for i, v in enumerate(["XXX", "ABCABC", "P", "JJJJJ"]):
f = etk.Image()
f.set_from_file('07-image/icon.png')
b = etk.Button(label="?")
b.on_clicked(show, "I don't know what is %s" % v)
combo.item_append(f, v, b)
def show_item(c, i):
print i.field_get(1)
#!/usr/bin/python
import etk
# Combobox
combo = etk.Combobox(columns=[
(etk.Combobox.IMAGE, 50, etk.Combobox.FILL, 0.0),
(etk.Combobox.LABEL, 50, etk.Combobox.FILL, 1.0),
(etk.Combobox.OTHER, 20, etk.Combobox.FILL, 0.0)])
combo.items_height = 50
def show(b, text):
print text
for i, v in enumerate(["XXX", "ABCABC", "P", "JJJJJ"]):
f = etk.Image()
f.set_from_file('07-image/icon.png')
b = etk.Button(label="?")
b.on_clicked(show, "I don't know what is %s" % v)
combo.item_append(f, v, b)
def show_item(c, i):
print i.field_get(1)