Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
filechooser.select_multiple_set(obj.active_get())
if data == "hidden":
filechooser.show_hidden_set(obj.active_get())
if data == "save":
filechooser.is_save_set(obj.active_get())
# File chooser
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())
if data == "multiple":
filechooser.select_multiple_set(obj.active_get())
if data == "hidden":
filechooser.show_hidden_set(obj.active_get())
if data == "save":
filechooser.is_save_set(obj.active_get())
# File chooser
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())
###################################
## Create Widget for the second tab
align = etk.Alignment(0.5, 0.5, 0.2, 0.0)
vbox = etk.VBox(False, 3)
align.add(vbox)
button_normal = etk.Button(label="Normal button")
vbox.append(button_normal, etk.VBox.START, etk.VBox.NONE, 0)
button_toggle = etk.ToggleButton(label="Toggle button")
vbox.append(button_toggle, etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check button 1")
vbox.append(etk.CheckButton(label="Check button 1"), etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check Button 2")
vbox.append(button_check, etk.VBox.START, etk.VBox.NONE, 0)
############
## Callbacks
def prev_cb(obj, note):
note.page_prev()
def next_cb(obj, note):
note.page_next()
def hide_tabs_toggled_cb(obj, note):
note.tabs_visible_set(not obj.active_get())
#!/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):
table.attach(labels[i], 0, 0, 2 + i, 2 + i, etk.Table.HFILL, 0, 0)
table.attach_default(entries[i], 1, 1, 2 + i, 2 + i)
## Create Widget for the second tab
align = etk.Alignment(0.5, 0.5, 0.2, 0.0)
vbox = etk.VBox(False, 3)
align.add(vbox)
button_normal = etk.Button(label="Normal button")
vbox.append(button_normal, etk.VBox.START, etk.VBox.NONE, 0)
button_toggle = etk.ToggleButton(label="Toggle button")
vbox.append(button_toggle, etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check button 1")
vbox.append(etk.CheckButton(label="Check button 1"), etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check Button 2")
vbox.append(button_check, etk.VBox.START, etk.VBox.NONE, 0)
############
## Callbacks
def prev_cb(obj, note):
note.page_prev()
def next_cb(obj, note):
note.page_next()
def hide_tabs_toggled_cb(obj, note):
note.tabs_visible_set(not obj.active_get())
##############
## Main Window
table.attach_default(buttons[2], 1, 1, 9, 9)
###################################
## Create Widget for the second tab
align = etk.Alignment(0.5, 0.5, 0.2, 0.0)
vbox = etk.VBox(False, 3)
align.add(vbox)
button_normal = etk.Button(label="Normal button")
vbox.append(button_normal, etk.VBox.START, etk.VBox.NONE, 0)
button_toggle = etk.ToggleButton(label="Toggle button")
vbox.append(button_toggle, etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check button 1")
vbox.append(etk.CheckButton(label="Check button 1"), etk.VBox.START, etk.VBox.NONE, 0)
button_check = etk.CheckButton(label="Check Button 2")
vbox.append(button_check, etk.VBox.START, etk.VBox.NONE, 0)
############
## Callbacks
def prev_cb(obj, note):
note.page_prev()
def next_cb(obj, note):
note.page_next()
def hide_tabs_toggled_cb(obj, note):
note.tabs_visible_set(not obj.active_get())
and Show / Hide hidden files '''
if data == "multiple":
filechooser.select_multiple_set(obj.active_get())
if data == "hidden":
filechooser.show_hidden_set(obj.active_get())
if data == "save":
filechooser.is_save_set(obj.active_get())
# File chooser
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)