Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_destroy():
a = App()
t = Text(a)
destroy_test(t)
a.destroy()
def test_display():
a = App()
c = Combo(a, ["foo", "bar"])
display_test(c)
a.destroy()
def test_text():
a = App()
# default values
t = Text(a, color=None, size=None, font=None)
text_test(t)
a.destroy()
def test_events():
a = App()
b = ButtonGroup(a, ["foo", "bar"])
events_test(b)
a.destroy()
def test_cascading_properties():
a = App()
b = Box(a)
cascading_properties_test(b)
a.destroy()
def test_repeat_schedule():
a = App()
b = PushButton(a)
schedule_repeat_test(a, b)
a.destroy()
def test_default_values():
a = App()
b = PushButton(a)
assert b.master == a
assert b.text == "Button"
assert b.grid == None
assert b.align == None
a.destroy()
def test_picture_pilobject():
from PIL import Image
a = App()
pil_image = Image.open("../examples/guizero.gif")
p = Picture(a, image=pil_image)
assert p.image == pil_image
assert p._image.tk_image is not None
assert p._image.pil_image is not None
a.destroy()
def test_animated_picture():
a = App()
p = Picture(a, image = "../examples/guizero_flash.gif")
assert p._image.tk_image is not None
assert p._image.pil_image is not None
assert p._image.animation
assert p._image_player.running
a.destroy()
# form converted from a tkinter example using column column and row spanning for layout
# http://www.dreamincode.net/forums/topic/371440-tkinter-overview-with-a-fixed-width-grid/
from guizero import App, MenuBar, Text, TextBox, Combo, Slider, CheckBox, ButtonGroup, Box, PushButton, info, yesno
# Draw the form using 'guizero' wrapper for tkinter
app = App("Simple Window", 400, 300, layout="grid")
# Setup the functions needed by the GUI controls
def exit_function():
print("File option")
app.destroy()
def edit_function():
print("Edit option")
def do_salaryScale(slider_value):
salaryLabel.value = "Salary : "+str(slider_value)
def do_fullTimeCheckBox():
if fullTimeCheckBox.value == 1:
app.title=("Simple Window (full-time)")
else: