Ejemplo n.º 1
0

def tipo():
    global funcao
    funcao = escolhaenfermeiro.get()
    #print(funcao)
    app1.destroy()


#Interface
app1 = App(title="Escolha o tipo de Enfermeiro: ",
           width=150,
           height=100,
           layout="grid")
escolhaenfermeiro = Combo(app1,
                          options=["transmissor", "recetor"],
                          grid=[0, 1])
descricaoenfermeiro = Text(
    app1,
    text="Tipos:",
    grid=[0, 0],
)
confirmar = PushButton(app1,
                       command=tipo,
                       text="Confirmar",
                       grid=[3, 1],
                       align="left")

app1.display()

app = App(title="Enfermeiro Móvel", layout="grid")
Ejemplo n.º 2
0
from guizero import App, TextBox, Text, Slider, PushButton, Picture, Combo, CheckBox, ButtonGroup, Box

app = App(title="different sizes", width=700, height=700)

text = Text(app, "lets change some sizes", width=20, height=2)

text_box = TextBox(app, "some text", width=50)

slider = Slider(app, width=300, height=30)

button = PushButton(app, width=20, height=2)

pic = Picture(app, image="guizero.gif", width=400, height=50)

combo = Combo(app, ["martin", "laura", "rik"], width=50, height=2)

check = CheckBox(app, "tick me", width=17, height=2)

button_group = ButtonGroup(app, ["cheese", "onion", "crisps"],
                           1,
                           width=35,
                           height=9)
button_group.bg = "darkgrey"

box = Box(app, width=100, height=100)
box.border = True

box.bg = "red"

app.display()
Ejemplo n.º 3
0
app = App(title="Student management system", layout="grid")

# Set up the Box areas for our layout
add_box = Box(app, grid=[0, 0], layout="grid")
search_box = Box(app, grid=[1, 0])
delete_box = Box(app, grid=[2, 0])
# This section has the GUI widgets in the add_box area
heading = Text(add_box, text="Add new student", grid=[0, 0])
name_lbl = Text(add_box, text="Name", grid=[0, 1])
name_text = TextBox(add_box, grid=[1, 1])
age_lbl = Text(add_box, text="Age", grid=[0, 2])
age_text = TextBox(add_box, grid=[1, 2])
phone_lbl = Text(add_box, text="Phone", grid=[0, 3])
phone_text = TextBox(add_box, grid=[1, 3])
gender_lbl = Text(add_box, text="Gender", grid=[0, 4])
gender_combo = Combo(add_box, options=["Male", "Female", "Other"], grid=[1, 4])
class_lbl = Text(add_box, text="Classes", grid=[0, 5], align="top")
class_listbox = ListBox(
    add_box, ["GRA", "BIO", "PHY", "MAT", "DTC", "ART", "ENG", "XYZ"],
    grid=[1, 5],
    multiselect=True)
add_button = PushButton(add_box,
                        text="Add student",
                        grid=[0, 6, 2, 1],
                        width=20,
                        command=add_student)
success_lbl = Text(add_box, grid=[0, 7, 2, 1])
delete_btn = PushButton(delete_box,
                        text="Delete Student",
                        command=delete_student)
# This is section where you add any GUI widgets to the search_box area
Ejemplo n.º 4
0
    def __init__(self, master):
        self.master = master
        #Creates the application window

        self.space2 = Text(master, text=" ", grid=[0, 0], width="fill")

        self.Shapemessage1 = Text(master,
                                  size=18,
                                  text="Waveform Shape:",
                                  grid=[0, 2],
                                  align="left",
                                  font="Times")

        self.Waveform1 = PushButton(master,
                                    text="Normal",
                                    grid=[1, 1],
                                    width="10",
                                    command=self.show_choices1)
        self.Waveform2 = PushButton(master,
                                    text="Abnormal",
                                    grid=[1, 2],
                                    width="10",
                                    command=self.show_choices2)
        self.Waveform3 = PushButton(master,
                                    text="Leveled",
                                    grid=[1, 3],
                                    width="10",
                                    command=self.show_choices3)

        #self.Waveform1.toggle()
        #self.Waveform2.toggle()
        #self.Waveform3.toggle()

        self.combo1 = Combo(
            master,
            options=["10", "11", "12", "13", "14", "15", "16", "17"],
            grid=[2, 1],
            command=self.modelone)
        self.combo2 = Combo(master,
                            options=[
                                "17", "18", "19", "20", "21", "22", "23", "24",
                                "25", "26"
                            ],
                            grid=[2, 2],
                            command=self.modeltwo)
        self.combo3 = Combo(master,
                            options=["0"],
                            grid=[2, 3],
                            command=self.modelthree)

        self.combo1.disable()
        self.combo2.disable()
        self.combo3.disable()
        #Creates the three waveform buttons as well as the selection for ICP value
        #When the waveform selected the user is then able to select an ICP value

        self.space2 = Text(master, text=" ", grid=[0, 6])
        #Creates space between Waveform Shape and Heart Rate

        self.HRmessage = Text(master,
                              size=18,
                              text="Heart Rate:",
                              grid=[0, 10],
                              align="left",
                              font="Times")
        #Creates the HR subtitle

        self.rate = TextBox(master, grid=[1, 10])
        self.HRunit = Text(master,
                           size=15,
                           text="BPM",
                           grid=[2, 10],
                           font="Times")
        #Creates the HR textbox to allow for typed input

        self.space3 = Text(master, text=" ", grid=[0, 11], font="Times")
        #Creates space between Heart Rate and the Update Button

        self.button = PushButton(master,
                                 command=self.update_value,
                                 width="12",
                                 height="10",
                                 text="Update",
                                 grid=[0, 13, 2, 2],
                                 align="bottom")
        #Creates an Update Button that updates the inputed information and exports the user-inputs to the next part of the program
        self.when_clicked = self.update_value
        #self.when_mouse_enters = self.update_value
        #Creates the update button, no new code will be executed until update button is pressed

        self.button = PushButton(master,
                                 command=self.calibration,
                                 width="12",
                                 height="4",
                                 text="Zero",
                                 grid=[2, 13],
                                 align="bottom")
        #Creates zero button which is used to calibrate

        self.button = PushButton(master,
                                 command=self.quit,
                                 width="12",
                                 height="4",
                                 text="Quit",
                                 grid=[2, 14],
                                 align="bottom")
        #Creates the quit button which will exit out of app and stop the process from running

        self.pid = -1  #Initialize process id
Ejemplo n.º 5
0
white = (255,255,255)

app = App(title="Abstract Art - Circle")


Text(app, text="Number of amount:", size=16)
amount_input = TextBox(app, text="500")

Text(app, text="File Saving", size=16)

Text(app, text="Filename with full path:")
fname_input = TextBox(app, text="/home/pi/Desktop/circle", width=20)

Text(app, text="File type:")
ftype_input = Combo(app, options=["png","jpeg","bmp","tga"])

Text(app, text="Advanced", size=16)

Text(app, text="Color brightness (255 is brightest):")
Slider(app, start=0, end=255, command=brightUpdate)

Text(app, text="Circle size:")
size_input = TextBox(app, text="50")

Text(app, text="Canvas size (x):")
x_input = TextBox(app, text="1092")

Text(app, text="Canvas size (y):")
y_input = TextBox(app, text="749")
Ejemplo n.º 6
0
def test_auto_layout():
    a = App()
    w = Combo(a)
    auto_layout_test(w, None)
    a.destroy()
Ejemplo n.º 7
0
largeur_boite = TextBox(premiere, "100", width=10, grid=[1, 2], align="left")

hauteur_tag = Text(premiere,
                   "Hauteur de la surface(mm)",
                   grid=[0, 3],
                   align="left")
hauteur_boite = TextBox(premiere, "100", width=10, grid=[1, 3], align="left")

espacement_tag = Text(premiere,
                      "Espacement (qualité d'impression)",
                      grid=[0, 4],
                      align="left")
selection_espacement = Combo(
    premiere,
    options=["0,4 mm", "0,8 mm", "1 mm", '2 mm', '3 mm', '5 mm'],
    selected='1 mm',
    command=confirmer_espacement,
    grid=[1, 4],
    align='left')

bouton_confirmer_premiere_page = PushButton(premiere,
                                            text="Confirmer les informations",
                                            command=confirmation_premiere_page,
                                            grid=[0, 5])

deuxieme = Window(premiere,
                  layout="grid",
                  title="Lancement de l'impression",
                  width=900,
                  height=500)
deuxieme.hide()
Ejemplo n.º 8
0
def test_update_command():
    a = App()

    callback_event = Event()

    def callback():
        callback_event.set()

    c = Combo(a, ["foo", "bar"])

    c._command_callback(c.value)
    assert not callback_event.is_set()

    c.update_command(callback)
    c._command_callback(c.value)
    assert callback_event.is_set()
    callback_event.clear()

    c.update_command(None)
    c._command_callback(c.value)
    assert not callback_event.is_set()

    a.destroy()
Ejemplo n.º 9
0
def test_after_schedule():
    a = App()
    c = Combo(a, ["foo", "bar"])
    schedule_after_test(a, c)
    a.destroy()
Ejemplo n.º 10
0
menubar = MenuBar(app, toplevel=["File"], options=[[["Exit", exit_function]]])

# Layout the app controls
firstNameLabel = Text(app,
                      text="First Name",
                      grid=[0, 0],
                      align="left",
                      size=10)
lastNameLabel = Text(app, text="Last Name", grid=[0, 1], align="left", size=10)
countryLabel = Text(app, text="Country", grid=[0, 2], align="left", size=10)
addressLabel = Text(app, text="Address", grid=[0, 3], align="left", size=10)

firstNameText = TextBox(app, width=25, grid=[1, 0])
lastNameText = TextBox(app, width=25, grid=[1, 1])
countryCombo = Combo(app,
                     options=['United Kingdom', 'United States', 'France'],
                     selected='United Kingdom',
                     grid=[1, 2])
box = Box(app, grid=[1, 3], layout="grid")

addressText1 = TextBox(box, width=25, grid=[0, 0])
addressText2 = TextBox(box, width=25, grid=[0, 1])
addressText3 = TextBox(box, width=25, grid=[0, 2])
addressText4 = TextBox(box, width=25, grid=[0, 3])
addressText5 = TextBox(box, width=25, grid=[0, 4])
addressText6 = TextBox(box, width=25, grid=[0, 5])

jobTitleLabel = Text(app, text="TBA", grid=[1, 4], size=10)

salaryLabel = Text(app, text="Salary : ", grid=[2, 0], align="left", size=10)
salaryScale = Slider(app,
                     start=10000,
Ejemplo n.º 11
0
from guizero import App, Text, ButtonGroup, Combo, PushButton, TextBox
app = App(title='Hero-o-matic', width=300)

def make_hero_name():
    adjective = bgp_adjective.value
    colour = txt_colour.value
    animal = cmb_animal.value
    hero = adjective + ' ' + colour + ' ' + animal
    lbl_output.value = 'You are... The '+hero+ "."

message1 = Text(app, text='Choose an adjective')
bgp_adjective= ButtonGroup(app, options=['Amazing', 'Bonny', 'Charming', 'Delightful'], selected='Amazing')

message2 = Text(app, text='Enter a colour')
txt_colour = TextBox(app)

message3 = Text(app, text='Pick an animal')
cmb_animal = Combo(app, options=['Aardvark', 'Badger', 'Cat', 'Dolphin', 'Velociraptor'])

btn_make_name = PushButton(app, text='Make me a hero', command=make_hero_name)

lbl_output= Text(app, text='A hero name will appear here')

app.display()
            newPosition = (position - key) % 26
            newCharacter = upperCaseAlphabet[newPosition]
        else:
            newCharacter = character
        newMessage += newCharacter
    output.value = newMessage


app = App(title="Secret messages", width="600", height="200", layout="grid")
message_description = Text(app,
                           text="Enter your message",
                           grid=[0, 0],
                           align="left")
unencrypted_message = TextBox(app, width="50", grid=[0, 1, 2, 1], align="left")
encryption_key = Combo(app,
                       options=["1", "2", "3", "4", "5"],
                       grid=[1, 2],
                       align="left")
key_description = Text(app, "Choose your key", grid=[0, 2])

output = Text(app, "view the result here", grid=[0, 3])

send_message = PushButton(app,
                          command=encrypt_message,
                          text="Encrypt",
                          grid=[0, 4],
                          align="left")
translate_message = PushButton(app,
                               command=decrypt_message,
                               text="Decrypt",
                               grid=[1, 4],
                               align="left")
            student_listbox.append(student.get_name())


# create the application interface

from guizero import App, Text, ListBox, PushButton, Combo

app = App(title="Student management system")

# This is section where you add any GUI widgets

heading = Text(app, text="List of Teachers", color=(210, 45, 17))
# List of teacher names
teacher_names = []
# Loop through the teachers and add their names to teacher_names
for t in teacher_list:
    teacher_names.append(t.get_tname())

# Create a listbox with all the teachers names displayed
teacher_list = ListBox(app, items=teacher_names, command=print_selection)

heading = Text(app, text="List of Classes", color=(210, 45, 17))

class_combo = Combo(app,
                    options=["GRA", "ENG", "PHY", "MAT", "ART"],
                    command=class_count)

heading = Text(app)
# Start the program
app.display()
Ejemplo n.º 14
0
def do_booking():
    info("Booking", "Loading")
    print( measure_choice.get() )
    print( map_option.get_value() )
    print( graphic_option.get_value() )
    if measure_choice.get()=="Humidity" and map_option.get_value()==True:
        Humidity_map()
    if measure_choice.get()=="Humidity" and graphic_option.get_value()==True:
        Humidity_graphic()
    if measure_choice.get()=="Temperature" and graphic_option.get_value()==True:
        Temperature_graphic()
    if measure_choice.get()=="Temperature" and map_option.get_value()==True:
        Temperature_map()
    if measure_choice.get()=="Pressure" and graphic_option.get_value()==True:
        Pressure_graphic()
    if measure_choice.get()=="Pressure" and map_option.get_value()==True:
        Pressure_map()
        
   

app = App(title="MMI", width=300, height=200, layout="grid")
measure_choice = Combo(app, options=["Pressure", "Humidity", "Temperature"], grid=[0,1], align="left")
film_description = Text(app, text="Which measure?", grid=[0,0], align="left")
map_option = CheckBox(app, text="Map", grid=[1,1], align="left")
graphic_option = CheckBox(app, text="Graphic", grid=[1,2], align="left")

confirmation_button = PushButton(app, command=do_booking, text="confirm", grid=[3,1], align="left")


app.display()
Ejemplo n.º 15
0
def test_cascaded_properties():
    a = App()
    c = Combo(a, ["foo", "bar"])
    cascaded_properties_test(a, c, True)
    a.destroy()
Ejemplo n.º 16
0
def test_repeat_schedule():
    a = App()
    c = Combo(a, ["foo", "bar"])
    schedule_repeat_test(a, c)
    a.destroy()
Ejemplo n.º 17
0
def test_inherited_properties():
    a = App()
    inherited_properties_test(a, lambda: Combo(a, ["foo", "bar"]), True)
    a.destroy()
Ejemplo n.º 18
0
def test_enable():
    a = App()
    c = Combo(a, ["foo", "bar"])
    enable_test(c)
    a.destroy()
Ejemplo n.º 19
0
dirs = [item for item in list(os.walk("."))[0][1] if not item.startswith(".")]

videoname = TextBox(app, grid=[1, 3], align="left")
videoname.value = "videoname"

labelVN = Text(app, grid=[0, 3], text="video name", align="left")

wdText = Text(app, grid=[1, 0], text="folder", align="left")

timeRecording = TextBox(app, grid=[1, 5], align="left")
timeRecording.value = "3"
labelTime = Text(app, grid=[0, 5], text="record time", align="left")

browserDir = Combo(app,
                   options=dirs,
                   command=select,
                   grid=[0, 0],
                   align="left")

parametersText = Text(app, grid=[1, 6], text="Parameters", align="left")

umbralText = TextBox(app, grid=[1, 7], align="left")
umbralText.value = "100"
umbralLabel = Text(app, grid=[0, 7], text="Treshold", align="left")

radioText = TextBox(app, grid=[3, 7], align="left")
radioText.value = "30"
radiolLabel = Text(app, grid=[2, 7], text="Radius", align="left")

fpsText = TextBox(app, grid=[1, 8], align="left")
fpsText.value = "25"
Ejemplo n.º 20
0
def test_display():
    a = App()
    c = Combo(a, ["foo", "bar"])
    display_test(c)
    a.destroy()
                             color="Red")
Kettle_covered_check = CheckBox(debug,
                                grid=[2, 21],
                                text="Kettle element covered",
                                command=kettle_covered_update)

########################################################################################################################

#declaring floats, string and bools
setpoint_mode_label = Text(app,
                           grid=[0, 14],
                           text="Setpoint mode",
                           size=15,
                           align="left")
setpoint_mode = Combo(app,
                      grid=[1, 14],
                      options=["Strike", "Sparge", "Manual Input"],
                      align="left")

HTL_temp_input_label = Text(debug,
                            grid=[0, 15],
                            text="Debug HTL temp",
                            size=15,
                            align="left")
HTL_temp_input = TextBox(debug, grid=[1, 15])
HTL_update_temp = PushButton(debug,
                             command=update_temp_htl,
                             grid=[2, 15],
                             text="Update temp",
                             align="left")

Mashtun_temp_input_label = Text(debug,
Ejemplo n.º 22
0
def test_text():
    a = App()
    c = Combo(a, ["foo", "bar"])
    text_test(c)
    a.destroy()
Ejemplo n.º 23
0
class MyGUI:
    def __init__(self, master):
        self.master = master
        #Creates the application window

        self.space2 = Text(master, text=" ", grid=[0, 0], width="fill")

        self.Shapemessage1 = Text(master,
                                  size=18,
                                  text="Waveform Shape:",
                                  grid=[0, 2],
                                  align="left",
                                  font="Times")

        self.Waveform1 = PushButton(master,
                                    text="Normal",
                                    grid=[1, 1],
                                    width="10",
                                    command=self.show_choices1)
        self.Waveform2 = PushButton(master,
                                    text="Abnormal",
                                    grid=[1, 2],
                                    width="10",
                                    command=self.show_choices2)
        self.Waveform3 = PushButton(master,
                                    text="Leveled",
                                    grid=[1, 3],
                                    width="10",
                                    command=self.show_choices3)

        #self.Waveform1.toggle()
        #self.Waveform2.toggle()
        #self.Waveform3.toggle()

        self.combo1 = Combo(
            master,
            options=["10", "11", "12", "13", "14", "15", "16", "17"],
            grid=[2, 1],
            command=self.modelone)
        self.combo2 = Combo(master,
                            options=[
                                "17", "18", "19", "20", "21", "22", "23", "24",
                                "25", "26"
                            ],
                            grid=[2, 2],
                            command=self.modeltwo)
        self.combo3 = Combo(master,
                            options=["0"],
                            grid=[2, 3],
                            command=self.modelthree)

        self.combo1.disable()
        self.combo2.disable()
        self.combo3.disable()
        #Creates the three waveform buttons as well as the selection for ICP value
        #When the waveform selected the user is then able to select an ICP value

        self.space2 = Text(master, text=" ", grid=[0, 6])
        #Creates space between Waveform Shape and Heart Rate

        self.HRmessage = Text(master,
                              size=18,
                              text="Heart Rate:",
                              grid=[0, 10],
                              align="left",
                              font="Times")
        #Creates the HR subtitle

        self.rate = TextBox(master, grid=[1, 10])
        self.HRunit = Text(master,
                           size=15,
                           text="BPM",
                           grid=[2, 10],
                           font="Times")
        #Creates the HR textbox to allow for typed input

        self.space3 = Text(master, text=" ", grid=[0, 11], font="Times")
        #Creates space between Heart Rate and the Update Button

        self.button = PushButton(master,
                                 command=self.update_value,
                                 width="12",
                                 height="10",
                                 text="Update",
                                 grid=[0, 13, 2, 2],
                                 align="bottom")
        #Creates an Update Button that updates the inputed information and exports the user-inputs to the next part of the program
        self.when_clicked = self.update_value
        #self.when_mouse_enters = self.update_value
        #Creates the update button, no new code will be executed until update button is pressed

        self.button = PushButton(master,
                                 command=self.calibration,
                                 width="12",
                                 height="4",
                                 text="Zero",
                                 grid=[2, 13],
                                 align="bottom")
        #Creates zero button which is used to calibrate

        self.button = PushButton(master,
                                 command=self.quit,
                                 width="12",
                                 height="4",
                                 text="Quit",
                                 grid=[2, 14],
                                 align="bottom")
        #Creates the quit button which will exit out of app and stop the process from running

        self.pid = -1  #Initialize process id

    #Launches the function for modelone , Normal ICP, in a seperate python process and obtains the process ID
    def modelone(self):
        self.done()

    #Launches the function for modeltwo , Leveled ICP, in a seperate python process and obtains the process ID
    def modeltwo(self):
        self.done()

    #Launches the function for modelthree, Abnormal ICP, in a seperate python process and obtains the process ID
    def modelthree(self):
        self.done()

    #Launches the calibration
    def calibration(self):
        self.done()
        self.process = subprocess.Popen('python calibration.py',
                                        shell=True,
                                        preexec_fn=os.setsid)
        self.pid = self.process.pid

    #Used to show the ICP value choices for the normal waveform
    def show_choices1(self):
        self.done()
        if self.Waveform1.value == 0:
            self.combo1.enable()
            self.combo2.disable()
            self.combo3.disable()
        if self.Waveform1.value == 1:
            self.combo1.disable()
            self.combo1.value = 0

    #Used to show the ICP value choices for the abnormal waveform
    def show_choices2(self):
        self.done()
        if self.Waveform2.value == 0:
            self.combo2.enable()
            self.combo1.disable()
            self.combo3.disable()
        if self.Waveform2.value == 1:
            self.combo2.disable()
            self.combo2.value = 0

    #Used to show the ICP value choices for the leveled waveform
    def show_choices3(self):
        self.done()
        if self.Waveform3.value == 0:
            self.combo3.enable()
            self.combo1.disable()
            self.combo2.disable()
        if self.Waveform3.value == 1:
            self.combo3.disable()
            self.combo3.value = 0

    #Command for updating the heart rate value
    def update_value(self):
        if self.rate.value == "":
            self.rate.value = 65
        if self.combo1.value == "10":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "11":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "12":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "13":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "14":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "15":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "16":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == "17":
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid

        if self.combo2.value == 21:
            self.process = subprocess.Popen('python modeltwo.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == 22:
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == 23:
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == 24:
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == 25:
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid
        if self.combo1.value == 26:
            self.process = subprocess.Popen('python modelone.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid

        if self.combo3.value == 0:
            self.process = subprocess.Popen('python modelthree.py {}'.format(
                self.rate.value),
                                            shell=True,
                                            preexec_fn=os.setsid)
            self.pid = self.process.pid

        self.combo1.disable()
        self.combo2.disable()
        self.combo3.disable()

    #Kills the process that is currently running
    def done(self):
        if self.pid > 0:
            try:
                os.killpg(os.getpgid(self.pid), signal.SIGTERM)
                self.pid = -1
            except ProcessLookupError:
                pass

    def quit(self):
        self.done()
        self.master.destroy()
Ejemplo n.º 24
0
def test_color():
    a = App()
    c = Combo(a, ["foo", "bar"])
    color_test(c)
    a.destroy()
Ejemplo n.º 25
0
robot = CamJamKitRobot()


def Stop():
    robot.stop()


app = App()

slider = Slider(app, command=slider_changed)
textbox = TextBox(app)

instructions = Text(app, text="Choose a forward speed")
combo = Combo(app,
              options=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
              command=you_chose_forward)
combo.width = 60
combo.height = 5
result = Text(app)

instructions = Text(app, text="Choose a backward speed")
combo = Combo(app,
              options=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
              command=you_chose_backward)
combo.width = 60
combo.height = 5
result = Text(app)

Turtle_button = PushButton(app, command=Turtle, text="Turtle")
Turtle_button.width = 20
Ejemplo n.º 26
0
def test_size():
    a = App()
    c = Combo(a, ["foo", "bar"])
    size_text_test(c)
    size_fill_test(c)
    a.destroy()
Ejemplo n.º 27
0
        "Booking", "Thank you for booking \n" + "Movie: " + film_choice.value +
        "\nSeat type: " + seat_type.value + "\nSeat location: " +
        row_choice.value)


#adds a text widget
app = App(title="My Second GUI app", width=300, height=200, layout="grid")

#adds a text widget
film_description = Text(app,
                        text="Select movie to watch",
                        grid=[0, 0],
                        align="left")
#adds a combo widget
film_choice = Combo(app,
                    options=["Star Wars", "Frozen", "Lion King"],
                    grid=[1, 0],
                    align="left")
#adds a text widget
seat_type_label = Text(app, text="Seat type", grid=[0, 1], align="left")
#adds radio button widget
seat_type = ButtonGroup(app,
                        options=[["VIP seat", "vip"],
                                 ["Regular seat", "regular"]],
                        selected="regular",
                        horizontal="True",
                        grid=[1, 1],
                        align="left")
#adds a text widget
seat_location = Text(app, text="Seat location", grid=[0, 2], align="left")
#adds radio button widget
row_choice = ButtonGroup(app,
Ejemplo n.º 28
0
def test_events():
    a = App()
    c = Combo(a, ["foo", "bar"])
    events_test(c)
    a.destroy()
    meme.text(
        20, 320, bottom_text.value,
        color=color.value,
        size=size.value,
        font=font.value,
        )


# App -------------------

app = App("meme")

top_text = TextBox(app, "top text", command=draw_meme)
bottom_text = TextBox(app, "bottom text", command=draw_meme)

color = Combo(app,
              options=["black", "white", "red", "green", "blue", "orange"],
              command=draw_meme, selected="blue")

font = Combo(app,
             options=["times new roman", "verdana", "courier", "impact"],
             command=draw_meme)

size = Slider(app, start=20, end=50, command=draw_meme)

meme = Drawing(app, width="fill", height="fill")

draw_meme()

app.display()
Ejemplo n.º 30
0
cest_dfreq_label = Text(cest_settings_window,
                        align='left',
                        text='Delta Frequenz',
                        grid=[0, 6])
cest_dfreq = TextBox(cest_settings_window,
                     text=cestProperties.dfreq,
                     align='left',
                     grid=[1, 6])

cest_alternating_label = Text(cest_settings_window,
                              align='left',
                              text='Alternating',
                              grid=[0, 7])
cest_alternating = Combo(cest_settings_window,
                         selected=cestProperties.alternating,
                         align='left',
                         options=["True", "False"],
                         grid=[1, 7])

cest_ndynamic_label = Text(cest_settings_window,
                           align='left',
                           text='Dynamiken',
                           grid=[0, 8])
cest_ndynamic = TextBox(cest_settings_window,
                        text=cestProperties.nDynamics,
                        align='left',
                        grid=[1, 8])

cest_gauss_label = Text(cest_settings_window,
                        align='left',
                        text='Gauss',