How to use the etk.main 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 / 09-canvas.py View on Github external
bla = c.object_add(r)

print bla

def mover(obj):
    (x, y) = c.child_position_get(bla)
    c.move(bla, x + 1, y + 1)
    return True

ecore.animator_add(mover, r)

def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 11-events.py View on Github external
print "%s -> z: %d   pos: (%d, %d)" % (ev.__class__, ev.z, ev.widget[0], ev.widget[1])
    return True
w.on_mouse_wheel(mouse_event_wheel)

def key_event(o, ev):
    print "%s -> key: %s" % (ev.__class__, ev.keyname)
    return True
w.on_key_down(key_event)
w.on_key_up(key_event)


def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 13-combobox.py View on Github external
def show_active_item(c):
    print c.active_item.field_get(0)

ce.on_active_item_changed(show_active_item)

# Main
box = etk.VBox()
box.append(combo, etk.VBox.START, etk.VBox.FILL, 0)
box.append(ce, etk.VBox.END, etk.VBox.FILL, 0)

w = etk.Window(title="Hello World", size_request=(300, 200), child=box)
w.on_destroyed(lambda x: etk.main_quit())
w.show_all()

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 07-image / 07-image.py View on Github external
#!/usr/bin/python

import etk

icon = etk.Image()
icon.set_from_file('icon.png')

box = etk.VBox()
box.append(icon, etk.VBox.START, etk.VBox.FILL, 0)

w = etk.Window(title="Hello World", size_request=(300, 300), child=box)
w.on_destroyed(lambda x: etk.main_quit())
w.show_all()

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 19-text.py View on Github external
print text
    out_tb.insert(iter_out, text)
b.on_clicked(sendButton_cb)

def on_destroyed(obj):
    etk.main_quit()
w.connect("destroyed", on_destroyed)

w.show_all()
w.resize(600,600)
v.position = 420




etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 01-button.py View on Github external
w = etk.Window(title="Button", size_request=(200, 200), child=b)
w.show_all()

def count(button):
    global counter
    counter += 1
    b.label = msg % counter
    print "button %s clicked" % button
    return True
b.on_clicked(count)

def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 10-virtual.py View on Github external
def _size_request(self):
        return (500, 500)

    def _theme_signal_emit(self, signal, size_recalc):
        print "signal=\"%s\"    size_recalc=%d" % (signal, size_recalc)

new = MyButton(label="lalalla")

w = etk.Window(title="Hello World", child=new)
w.show_all()

def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 17-filechooser_widget.py View on Github external
dialog.pack_widget_in_action_area(show_hidden, etk.VBox.START, etk.VBox.NONE, 0)
dialog.pack_widget_in_action_area(is_save, etk.VBox.START, etk.VBox.NONE, 0)
open = dialog.button_add_from_stock(etk.c_etk.StockEnums.DOCUMENT_OPEN, 1)
close = dialog.button_add_from_stock(etk.c_etk.StockEnums.DIALOG_CLOSE, 2)

# Events catchers
select_multiple.connect("toggled", chk_btns, "multiple")
show_hidden.connect("toggled", chk_btns, "hidden")
is_save.connect("toggled", chk_btns, "save")
open.connect("clicked", print_selected)
close.connect("clicked", lambda x: etk.main_quit())

dialog.on_destroyed(lambda x: etk.main_quit())
dialog.show_all()

etk.main()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 00-hello_world.py View on Github external
#!/usr/bin/python

import etk

l = etk.Label(text="Hello World", alignment=(0.5, 0.5))
w = etk.Window(title="Hello World", size_request=(200, 200), child=l)
w.show_all()

def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()
github drf / amsn2 / python-etk / examples / 09-canvas.py View on Github external
bla = c.object_add(r)

print bla

def mover(obj):
    (x, y) = c.child_position_get(bla)
    c.move(bla, x + 1, y + 1)
    return True

ecore.animator_add(mover, r)

def quit(obj):
    etk.main_quit()
w.on_destroyed(quit)

etk.main()