예제 #1
0
def test_height():
    a = App()

    t1 = TextBox(a)
    t1.height = 10
    #cant change height of single line text box
    assert t1.height == 1

    t2 = TextBox(a, multiline=True)
    default_height = t2.height
    t2.height = 10
    assert t2.height == 10
    t2.height = "fill"
    assert t2.height == "fill"

    a.destroy()
            password_chk_text.value = "correct"
            sleep(.2)
            mainmenu_window.show(wait=True)
            admin_mainmenu_pass_window.hide()
            password_box.value = ""
        else:
            password_chk_text.value = "incorrect"
            password_box.value = ""
    
    elif not password_box.value == admin_password:
         password_chk_text.value = "incomplete and incorrect"
         
    
    
password_box = TextBox(admin_mainmenu_pass_window,  grid=[0,0])
password_box.height=30
password_box.width=20
password_box.update_command(chk_password)
password_chk_text = Text (admin_mainmenu_pass_window, text="", grid=[1,0])
#admin menu password window ends

#change admin password password window starts
def chk_chg_password():
    passw = readPwd()
    if len(pass_box.value) == 8:
        if pass_box.value == passw:#admin_password:
            pass_chk_text.value = "correct"
            sleep(.2)
            change_password_window.show(wait=True)
            change_pass_password_window.hide()
        else:
        if password_box.value == readPwd():  #admin_password:
            password_chk_text.value = "correct"
            sleep(.2)
            mainmenu_window.show(wait=True)
            admin_mainmenu_pass_window.hide()
            password_box.value = ""
        else:
            password_chk_text.value = "incorrect"
            password_box.value = ""

    elif not password_box.value == admin_password:
        password_chk_text.value = "incomplete and incorrect"


password_box = TextBox(admin_mainmenu_pass_window, grid=[0, 0])
password_box.height = 30
password_box.width = 20
password_box.update_command(chk_password)
password_chk_text = Text(admin_mainmenu_pass_window, text="", grid=[1, 0])

#admin menu password window ends


#change admin password password window starts
def chk_chg_password():
    passw = readPwd()
    if len(pass_box.value) == 8:
        if pass_box.value == passw:  #admin_password:
            pass_chk_text.value = "correct"
            sleep(.2)
            change_password_window.show(wait=True)
예제 #4
0
use_fixture.bg = "#999999"
use_fixture.text_size=20
# Buttons
tst_btn = PushButton(button_box, command=begin_test, text = "6. Begin Test", grid=[0,6])
tst_btn.text_size = 30
tst_btn.enabled = False
save_btn = PushButton(button_box, command=save_test, text = "7. Save Test", grid=[1,6])
save_btn.text_size = 30
save_btn.enabled = False
graph_box = Box(app, layout="grid", grid=[6,0,6,6], border=3)
noise_btn = PushButton(graph_box, command=plot_noise, image="Noise_400x300.png", grid=[0,0])
counts_btn = PushButton(graph_box, command=plot_counts, image="Counts_400x300.png", grid=[1,0])

results_box = Box(app, layout='grid', grid=[0,6, 7,6], border=3)
results_lbl = Text(results_box, grid=[0,0], text="Test Results: Passed")
results_lbl.text_size = 30
results_lbl.bg='green'

# make a multiline test from list
fill = ""
for l in item_numbers:
    fill += str(l) +"\n"
    

result_txtbox=TextBox(results_box, grid=[0,1], text=fill, align="left", multiline=True, scrollbar=True)
result_txtbox.height = 15
result_txtbox.width = 175

app.display()