How to use the etk.c_etk.StockEnums 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 / 17-filechooser_widget.py View on Github external
filechooser = etk.FilechooserWidget()

# Dialog
dialog = etk.Dialog(title="FilechooserWidget Test Python-Etk")

# Check boxes
select_multiple = etk.CheckButton (label="Select Multiple")
show_hidden = etk.CheckButton (label="Show hidden")
is_save = etk.CheckButton (label="Is save")

# Place the elements into the dialog
dialog.pack_in_main_area (filechooser, etk.VBox.START, etk.VBox.EXPAND_FILL, 0)
dialog.pack_widget_in_action_area(select_multiple, etk.VBox.START, etk.VBox.NONE, 0)
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 / 17-filechooser_widget.py View on Github external
# Dialog
dialog = etk.Dialog(title="FilechooserWidget Test Python-Etk")

# Check boxes
select_multiple = etk.CheckButton (label="Select Multiple")
show_hidden = etk.CheckButton (label="Show hidden")
is_save = etk.CheckButton (label="Is save")

# Place the elements into the dialog
dialog.pack_in_main_area (filechooser, etk.VBox.START, etk.VBox.EXPAND_FILL, 0)
dialog.pack_widget_in_action_area(select_multiple, etk.VBox.START, etk.VBox.NONE, 0)
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 / 18-menu.py View on Github external
#!/usr/bin/python

import etk

cols = 1
rows = 2

helpImage = etk.Image()
helpImage.set_from_stock(etk.c_etk.StockEnums.HELP_BROWSER, etk.c_etk.StockEnums.SMALL)

def giveHelp(menu):
    print 'Sorry! :)'

t = etk.Table(cols=cols, rows=rows, homogeneous=etk.Table.NOT_HOMOGENEOUS)


mb = etk.MenuBar()
menuFileButton = etk.MenuItem(label='File')
menuHelpButton = etk.MenuItemImage(label='Help!')
menuHelpButton.image = helpImage #this image won't be displayed in the menubar
menuHelpButton.on_activated(giveHelp) #this event is not triggered
menuSeparator = etk.MenuItemSeparator()

#MenuFile
menuFile = etk.Menu()
github kakaroto / e17 / OLD / BINDINGS / python / python-etk / examples / 20-notebook.py View on Github external
#!/usr/bin/python

import etk

##################################
## Create Widget for the first tab
image = etk.Image()
image.set_from_stock (etk.c_etk.StockEnums.APPLICATIONS_DEVELOPMENT, etk.c_etk.StockEnums.BIG)

buttons = [etk.Button(), etk.CheckButton(), etk.CheckButton()]
buttons[0].set_from_stock (etk.c_etk.StockEnums.DOCUMENT_OPEN)

labels = [etk.Label(text="App Name"), etk.Label(text="Generic Info"),
		etk.Label(text="Comments"), etk.Label(text="Executable"),
		etk.Label(text="Window Name"),etk.Label(text="Window Class"),
		etk.Label(text="Startup Notify"),etk.Label(text="Wait Exit")]

entries = [etk.Entry() for i in range(6)]

table = etk.Table(cols=2, rows=10, homogeneous=etk.Table.NOT_HOMOGENEOUS)
table.attach(image, 0, 0, 0, 0, etk.Table.NONE, 0, 0)
table.attach(buttons[0], 1, 1, 0, 0, etk.Table.HEXPAND, 0, 0)

for i in range(6):