How to use the etk.Combobox function in etk

To help you get started, we’ve selected a few etk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 13-combobox.py View on Github external
#!/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):
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 13-combobox.py View on Github external
#!/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)
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 13-combobox.py View on Github external
#!/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)
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 13-combobox.py View on Github external
#!/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)