def game(): global app, questions, answers, correct_answers, qnum, questionText, btn1, btn2, btn3, btn4, nextBtn eh.light.on() questionText = Text(app, questions[qnum]) questionText.text_size = 40 buttons_box = Box(app, width="fill", align="top") btn1 = PushButton(buttons_box, text=answers[qnum][0], align="left") btn1.bg = "blue" btn1.text_color = "white" btn1.text_size = 40 btn2 = PushButton(buttons_box, text=answers[qnum][1], align="left") btn2.bg = (209, 182, 16) btn2.text_color = "white" btn2.text_size = 40 btn3 = PushButton(buttons_box, text=answers[qnum][2], align="left") btn3.bg = "red" btn3.text_color = "white" btn3.text_size = 40 btn4 = PushButton(buttons_box, text=answers[qnum][3], align="left") btn4.bg = "green" btn4.text_color = "white" btn4.text_size = 40 nextBtn = PushButton(app, command=nextQ, text="Next", align="left")
def spin_up_main_buttons(parent, commands): global buttons_box buttons_box = Box(parent, width='fill', height='fill', layout='auto') scan_in_button = PushButton(buttons_box, text='SCAN IN', height='fill', width='fill') scan_in_button.font = display_config.text_font scan_in_button.text_color = '#00FF21' scan_in_button.text_size = display_config.button_text_size scan_in_button.update_command(commands[0]) scan_out_button = PushButton(buttons_box, text='SCAN OUT', height='fill', width='fill') scan_out_button.font = display_config.text_font scan_out_button.text_color = '#B60000' scan_out_button.text_size = display_config.button_text_size scan_out_button.update_command(commands[1]) look_up_button = PushButton(buttons_box, text='LOOKUP', height='fill', width='fill') look_up_button.font = display_config.text_font look_up_button.text_color = '#FFD800' look_up_button.text_size = display_config.button_text_size look_up_button.update_command(commands[2])
def staticDrill(self,appname): from guizero import Box appname = appname # second_message.value = "Static Passing Selected" self.drillType = "Static" self.window1 = Window(app, bg="#424242",height=280, width=480, layout="grid") # logo = Picture(self.window1, image="include/logo.gif", align="left", grid=[0, 0]) # logo.resize(40, 40) Heading = Text(self.window1, "Basic Tracking", size=18, font="Calibri Bold", color="white",grid=[1,0,3,1]) Slide1 = Text(self.window1, "Ball Speed:", size=14, font="Calibri Bold", color="white", grid=[1, 1]) # , 2, 1]) speed = Slider(self.window1, command=self.ball_speed_slider, start=1, end=5, grid=[1, 2]) speed.width = 150 speed.text_color = "black" speed.bg = "white" speed.text_size=14 Slide2 = Text(self.window1, "Pass Difficulty:", size=14, font="Calibri Bold", color="white", grid=[3, 1]) difficulty = Slider(self.window1, command=self.difficulty_slider, start=1, end=5, grid=[3, 2]) difficulty.width = 150 difficulty.text_color = "black" difficulty.bg = "white" difficulty.text_size=14 start = PushButton(self.window1, command=self.start_command, args=[self.ballSpeed, self.difficulty, self.drillType, appname], image="include/images/startbut.png", grid=[1, 5]) start.bg = "#37f100" start.text_color = "white" stop = PushButton(self.window1, command=self.pause_command, args=[self.window1], image="include/images/pausebut.png", grid=[3, 5]) stop.bg = "#ffb000" stop.text_color = "white" exit_win = PushButton(self.window1, command=self.exit_command, args=[appname, self.window1], image="include/images/stopbut.png", grid=[1, 6]) exit_win.bg = "#e9002a" exit_win.text_color = "white" camera = PushButton(self.window1, command=self.show_cam, args=[], image="include/images/camerabut.png", grid=[3, 6]) camera.bg = "#002ff5" camera.text_color = "white" Center = Box(self.window1, width=50, height=165, grid=[2, 1, 1, 7]) Left = Box(self.window1, width=60, height=200, grid=[0, 0, 1, 7]) Right = Box(self.window1, width=20, height=200, grid=[4, 0, 1, 7]) VC = PushButton(Center, command=self.enable_voice, args=[], image="include/images/micbut.png", align="bottom")
def manualDrill(self,appname): # if self.player != "None": from guizero import Box appname = appname # second_message.value = "Entering Manual Mode" self.drillType = "Manual" self.window3 = Window(app, bg="#424242",height=280, width=480, layout="grid") # logo = Picture(self.window3, image="include/logo.gif", align="left", grid=[0, 0]) # logo.resize(75, 75) Heading = Text(self.window3, "Voice Activated Launch", size=18, font="Calibri Bold", color="white",grid=[1,0,3,1]) Slide1 = Text(self.window3, "Ball Speed:", size=14, font="Calibri Bold", color="white", grid=[1, 1]) # , 2, 1]) speed = Slider(self.window3, command=self.ball_speed_slider, start=1, end=5, grid=[1, 2]) speed.width = 150 speed.text_color = "black" speed.bg = "white" speed.text_size=14 Slide2 = Text(self.window3, "Pass Difficulty:", size=14, font="Calibri Bold", color="white", grid=[3, 1]) difficulty = Slider(self.window3, command=self.difficulty_slider, start=1, end=5, grid=[3, 2]) # , 2, 1]) difficulty.width = 150 difficulty.text_color = "black" difficulty.bg = "white" difficulty.text_size=14 start = PushButton(self.window3, command=self.start_command, args=[self.ballSpeed, self.difficulty, self.drillType, appname], image="include/images/startbut.png", grid=[1, 5]) start.bg = "#37f100" start.text_color = "white" stop = PushButton(self.window3, command=self.pause_command, args=[self.window3], image="include/images/pausebut.png", grid=[3, 5]) stop.bg = "#ffb000" stop.text_color = "white" exit_win = PushButton(self.window3, command=self.exit_command, args=[appname, self.window3], image="include/images/stopbut.png", grid=[1, 6]) exit_win.bg = "#e9002a" exit_win.text_color = "white" camera = PushButton(self.window3, command=self.show_cam, args=[], image="include/images/camerabut.png", grid=[3, 6]) camera.bg = "#002ff5" camera.text_color = "white" Center = Box(self.window3, width=50, height=200, grid=[2, 1, 1, 7]) Left = Box(self.window3, width=60, height=200, grid=[0, 0, 1, 7]) Right = Box(self.window3, width=20, height=200, grid=[4, 0, 1, 7])
def get_hip(): window = Window(app, title="R&B", height="320", width="480", bg="light slate blue") window.tk.attributes("-fullscreen", True) def play_hiphop(): get_files(directories[6], window) def play_classicrb(): get_files(directories[7], window) def close_get_hip(): window.hide() welcome_message = Text(window, text="R&B", size=30, font="Arial", color="white", align="top") hiphop_button = PushButton(window, command=play_hiphop, text="Hip Hop", align="left") hiphop_button.text_color = "purple4" hiphop_button.text_size = "12" hiphop_button.font = "Arial" hiphop_button.bg = "white" classicrb_button = PushButton(window, command=play_classicrb, text="Classic R & B", align="right") classicrb_button.text_color = "purple4" classicrb_button.text_size = "12" classicrb_button.font = "Arial" classicrb_button.bg = "white" close_get_hip = PushButton(window, text="go back", command=close_get_hip, align="bottom") close_get_hip.text_color = "purple4" close_get_hip.text_size = "12" close_get_hip.font = "Arial" close_get_hip.bg = "white"
def spin_up_edit_button(parent, command): global new_item_confirm_button new_item_confirm_button = PushButton(parent, text='DONE', command=command, width='fill', grid=[3, 4, 1, 2], align='left') new_item_confirm_button.font = display_config.text_font new_item_confirm_button.text_color = '#00FF21' new_item_confirm_button.text_size = display_config.text_size new_item_confirm_button.hide()
def spin_up_confirm_widget(parent): global question # question = Text(parent, text='Item not known!\r\rWould you like to enter missing values?') question = Text(parent) question.font = display_config.text_font question.text_size = display_config.text_size question.text_color = display_config.text_color question.height = 4 global buttons_box buttons_box = Box(parent) global yes_button yes_button = PushButton(buttons_box, text='Yes', align='left', width=5) yes_button.font = display_config.text_font yes_button.text_color = '#00FF21' yes_button.text_size = display_config.button_text_size global no_button no_button = PushButton(buttons_box, text='No', align='right', width=5) no_button.font = display_config.text_font no_button.text_color = '#B60000' no_button.text_size = display_config.button_text_size
def createButton(box, def_text_size, def_colour, text='', command=passFunction, args=[], grid=[]): width = 15 height = 1 b1 = PushButton(box, text=text, command=command, args=args, grid=grid, width=width, height=height, align='left') b1.text_size = def_text_size b1.text_color = def_colour
b2 = PushButton(app, grid=[1,2],align='top',text="5v",width=6,height=1) b2.bg = 'red' b3 = PushButton(app, grid=[0,3],align='top',text="GPIO2",width=6,height=1, command = clicked, args=[0]) b3.bg = 'green' b4 = PushButton(app, grid=[1,3],align='top',text="5v",width=6,height=1) b4.bg = 'red' b5 = PushButton(app, grid=[0,4],align='top',text="GPIO3",width=6,height=1, command = clicked, args=[1]) b5.bg = 'green' b6 = PushButton(app, grid=[1,4],align='top',text="GND",width=6,height=1) b6.bg = 'black' b6.text_color='white' b7 = PushButton(app, grid=[0,5],align='top',text="GPIO4",width=6,height=1, command = clicked, args=[2]) b7.bg = 'green' b8 = PushButton(app, grid=[1,5],align='top',text="GPIO14",width=6,height=1, command = clicked, args=[3]) b8.bg = 'green' b9 = PushButton(app, grid=[0,6],align='top',text="GND",width=6,height=1) b9.bg = 'black' b9.text_color='white' b10 = PushButton(app, grid=[1,6],align='top',text="GPIO15",width=6,height=1, command = clicked, args=[4]) b10.bg = 'green' b11 = PushButton(app, grid=[0,7],align='top',text="GPIO17",width=6,height=1, command = clicked, args=[5])
agbox = Box(admin_tab, grid=[4, 0]) # Admin row 2 adbox = Box(admin_tab, grid=[1, 1]) aebox = Box(admin_tab, grid=[2, 1]) afbox = Box(admin_tab, grid=[3, 1]) # This section has the GUI widgets in the cbox area # Loop through the course_list and create a button for each one for course in course_list: course_btn = PushButton(cbox, text=course.get_cname(), width=10, height=3) course_btn.bg = (129, 217, 222) course_btn.text_color = (255, 255, 255) course_btn.update_command(food_details, [course.get_cname()]) admin_button = PushButton(cbox, text="Admin", command=admin_access, width=10, height=3) admin_button.bg = (129, 217, 222) admin_button.text_color = (255, 255, 255) food_listbox = ListBox(fbox) food_listbox.update_command(add_food) order_listbox = ListBox(obox, width=200, height=200) delete_button = PushButton(obox, text="Undo", command=undo) clear_button = PushButton(obox, text="Clear", command=clear_order)
last_fed_time = Text(title_box_right, size=24, align="bottom", height="fill", width="fill", text="--:--") # Button box buttons_box = Box(app, width="fill", height="fill", align="top", border=True) manual_feed_toggle_button = PushButton(buttons_box, align="left", text="Toggle Feed", width="fill", height="fill") manual_feed_toggle_button.bg = BLUE manual_feed_toggle_button.text_color = WHITE manual_feed_toggle_button.text_size = BUTTON_TEXT_SIZE manual_feed_toggle_button.when_left_button_pressed = manual_feed_toggle manual_feed_toggle_button.when_left_button_released = manual_feed_toggle manual_single_feed_button = PushButton(buttons_box, align="right", text="Manual Feed", width="fill", height="fill", command=manual_single_feed) manual_single_feed_button.bg = BLUE manual_single_feed_button.text_color = WHITE manual_single_feed_button.text_size = BUTTON_TEXT_SIZE # Status box status_box = Box(app, width="fill", height="fill", align="bottom", border=True)
slider = Slider(a) b = Box(a) textbox = TextBox(b, text="or colours") bgroup = ButtonGroup(b, ["cheese", "ham", "salad"], 1) #a.bg = (255,255,0) text.text_color = "red" text.text_size = 30 text.font = "verdana" #text.bg = "green" check.bg = "#d41789" combo.bg = "blue" combo.text_color = None combo.text_size = 24 #button.bg = "black" button.text_color = (255, 0, 255) button.font = "arial" button.text_size = 18 slider.bg = (123, 234, 12) #textbox.bg = "cyan" textbox.font = "courier" textbox.text_color = "#FF0000" b.bg = "cyan" b.font = "wingdings" #bgroup.bg = "yellow" bgroup.text_color = "#e62112" bgroup.text_color = None bgroup.font = "book antiqua" #a.bg = (255,0,25) #a.font = "wingdings"
def rock_out(): window = Window(app, title="ROCK", height="320", width="480", bg="firebrick4", layout="grid") window.tk.attributes("-fullscreen", True) def play_alternative(): get_files(directories[0], window) def play_classicrock(): get_files(directories[1], window) def play_industrial(): get_files(directories[2], window) def play_metal(): get_files(directories[3], window) def play_indie(): get_files(directories[4], window) def play_pop(): get_files(directories[5], window) def close_rock_out(): window.hide() welcome_message = Text(window, text="ROCK", size=30, font="Courier New", color="white", grid=[3, 0]) classicrock_button = PushButton(window, width=14, command=play_classicrock, text="Classic Rock", grid=[1, 2]) classicrock_button.text_color = "white" classicrock_button.text_size = "12" classicrock_button.font = "Courier New" alternative_button = PushButton(window, width=14, command=play_alternative, text="Alternative", grid=[3, 2]) alternative_button.text_color = "white" alternative_button.text_size = "12" alternative_button.font = "Courier New" industrial_button = PushButton(window, width=14, command=play_industrial, text="Industrial", grid=[5, 2]) industrial_button.text_color = "white" industrial_button.text_size = "12" industrial_button.font = "Courier New" metal_button = PushButton(window, width=14, command=play_metal, text="Metal", grid=[1, 4]) metal_button.text_color = "white" metal_button.text_size = "12" metal_button.font = "Courier New" indie_button = PushButton(window, width=14, command=play_indie, text="Indie", grid=[3, 4]) indie_button.text_color = "white" indie_button.text_size = "12" indie_button.font = "Courier New" pop_button = PushButton(window, width=14, command=play_pop, text="Pop", grid=[5, 4]) pop_button.text_color = "white" pop_button.text_size = "12" pop_button.font = "Courier New" close_rock_out = PushButton(window, text="go back", command=close_rock_out, grid=[3, 6]) close_rock_out.text_color = "white" close_rock_out.font = "Courier New"
# Setup the App name thermostatPi3_name_w = Text(app, text=" thermostatPi3", grid=[1, 0], align="left") thermostatPi3_name_w.text_color = "gray" # Temperature controls temp_up_w = PushButton(app, text="TEMP UP", command=increase_set_point, grid=[2, 1], align="right") temp_up_w.tk.config(highlightthickness=0) temp_up_w.tk.config(borderwidth=0) temp_up_w.text_color = "red" temp_down_w = PushButton(app, text="TEMP DOWN", command=decrease_set_point, grid=[2, 3], align="right") temp_down_w.tk.config(highlightthickness=0) temp_down_w.tk.config(borderwidth=0) temp_down_w.text_color = "blue" # Settings settings_w = PushButton(app, text="Settings", command=settings_window_open, grid=[0, 3],
buttonBox3.show() #welcome screen titleText = Text(app, text = "Insult Generator", color="firebrick3", size=38, font="Free Mono", align="top") welcomeBox = Box(app, border=0, align="top") buttonBox1 = Box(app, width="fill", align="bottom") prisonmike = Picture(welcomeBox, image="prisonmike.gif", align="top") insultButton = PushButton(buttonBox1, text="Generate Insult", command = insultScreen, align="bottom") insultButton.text_size = 15 insultButton.font = "Free Mono" insultButton.bg = "firebrick3" insultButton.text_color = "snow" #insult screen insultBox = Box(app, border=0, align="top") insultBox.hide() buttonBox2 = Box(app, width="fill", align="bottom") buttonBox2.hide() backButton1 = PushButton(buttonBox2, text="<< Back", command=welcomeScreen, align = "left") backButton1.text_size = 15 backButton1.font = "Free Mono" backButton1.bg = "firebrick3" backButton1.text_color = "snow"
space2.text_color = "white" text_pengisian = Text(window, text="Jumlah Total Pengisian Solar (liter)", size=30, grid=(1, 0, 1, 1)) pengisianVal = Text(window, text="0", size=140) pengisianVal.repeat(100, set_totalizer) pulse_value = Text(window, text=pulse_signal.value, size=14) pulse_value.text_color = "black" pulse_value.repeat(100, pulseVal) cumulative_counting = Text(window, text="0", size=14) cumulative_counting.text_color = "black" cumulative_counting.repeat(10, normalCounting) button_send = PushButton(window, text="Send Data", command=monitoring) button_send.bg = "blue" button_send.text_color = "white" button_send.width = 12 button_send.height = 2 button_monitoring = PushButton(window, text="<<", command=monitoring, align="bottom") #button_monitoring.bg="green" #button_monitoring.text_color="white" button_monitoring.width = 5 button_monitoring.height = 2 window.hide() #button_reset = PushButton(app, text="Reset") #button_reset.bg="white" #button_reset.text_color="Black"
"/home/pi/Music/Latin/", "/home/pi/Music/New Age/", "/home/pi/Music/Spiritual/" ] #-------------------------------------------Main App Display---------------------------------- welcome_message = Text(app, text="PICK YOUR PLAYLIST", size=25, font="Georgia", color="midnight blue") rock_button = PushButton(app, width="fill", height=2, command=rock_out, text="ROCK") rock_button.text_color = "white" rock_button.text_size = "12" rock_button.font = "Georgia" rb_button = PushButton(app, width="fill", height=2, command=get_hip, text="R & B") rb_button.text_color = "white" rb_button.text_size = "12" rb_button.font = "Georgia" other_button = PushButton(app, width="fill", height=2, command=be_different, text="OTHER")
relayTitle=Text(relay_box, text="Relay Control",grid=[0,0],width="fill") rlyCntl_box=Box(relay_box,layout="grid",border=0,grid=[0,1]) rly1Label=Text(rlyCntl_box,text='1:',grid=[0,0]) rly2Label=Text(rlyCntl_box,text='2:',grid=[0,1]) rly1Cntl=ButtonGroup(rlyCntl_box, command=relay1Change, options=["OPEN", "CLOSE"], selected="OPEN",horizontal=True,grid=[1,0]) rly1Cnt2=ButtonGroup(rlyCntl_box, command=relay2Change, options=["OPEN", "CLOSE"], selected="OPEN",horizontal=True,grid=[1,1]) #Create and populate the LED box - we use the ButtonGroup widget here led_box=Box(rBox,width="fill", height="fill", border=1,layout="grid") ledLabel=Text(led_box,text="LED:",grid=[0,0]) ledCntl=ButtonGroup(led_box, command=ledChange, options=["ON", "OFF"], selected="ON",horizontal=True,grid=[1,0]) #Create and populate the button box - we use the PushButton widget here butt_box=Box(rBox,width="fill", height="fill", border=0) cmdrefButton=PushButton(butt_box, width="fill", text="Command Reference", command=openRef) cmdrefButton.text_color="#008000" #Create and populate the DIO box dio_box=Box(r2Box,width="fill", height="fill", border=1) dioTitle=Text(dio_box,text="Digital I/O",align="top") #Digital input setup for channels 1-4. This section relies on the Text widget din_box=Box(dio_box,width="fill", border=1,layout="grid") din_Title0=Text(din_box, text=' Basic Inputs',grid=[0,0,2,1],width="fill") dinLabel1=Text(din_box, text='1:',width="fill",grid=[0,1]) dinLabel2=Text(din_box, text='2:',width="fill",grid=[0,2]) dinLabel3=Text(din_box, text='3:',width="fill",grid=[0,3]) dinLabel4=Text(din_box, text='4:',width="fill",grid=[0,4]) dinVal1=Text(din_box, text='1',width="fill",grid=[1,1]) dinVal2=Text(din_box, text='1',width="fill",grid=[1,2]) dinVal3=Text(din_box, text='1',width="fill",grid=[1,3])
#pulse_value =Text(app, text= pulse_signal.value, size=14, grid=[4,6,1,1], align="left") #pulse_value.text_color= "black" #pulse_value.repeat(10,pulseVal) #cumulative_counting =Text(app, text="0", size=14, grid=[4,7,1,1], align="left") #cumulative_counting.text_color= "black" #cumulative_counting.repeat (10,normalCounting) # Text Box # input_target = TextBox(app, text="", grid=[1, 3, 3, 1]) input_target.text_size = 30 input_target.bg = "white" # Keypad # button1 = PushButton(app, Keypad_1, text="1", grid=[1, 4, 1, 1]) button1.bg = "black" button1.text_color = "white" button1.width = 5 button1.height = 2 button1.text_size = 15 button2 = PushButton(app, Keypad_2, text="2", grid=[2, 4, 1, 1]) button2.bg = "black" button2.text_color = "white" button2.width = 5 button2.height = 2 button2.text_size = 15 button3 = PushButton(app, Keypad_3, text="3", grid=[3, 4, 1, 1]) button3.bg = "black" button3.text_color = "white" button3.width = 5 button3.height = 2 button3.text_size = 15
from guizero import App, Text, Picture, PushButton, MenuBar, Slider, CheckBox, Combo app = App() text = Text(app, align="bottom", text="This is GUI", color="blue", font="Times New Roman", size="70") def do_somthing(): print("you have a button") picture = Picture(app, image="Image.gif") def do_something(): print("you did something else") menubar = MenuBar(app, toplevel=["file", "edit", "settings", "window"], options=[ [["File Option 1", do_something], ["file Option 2", do_something]], [["edit Option 1", do_somthing], ["edit Option 2", do_somthing]], [["settings Option 1", do_somthing], ["settings Option 2", do_somthing]], [["Window Option 1", do_somthing], ["Window Option 2", do_somthing]], ]) button = PushButton(app, text="Push me!", align="right", width="3", height="2", command=do_somthing) button.text_color = "blue" button.text_size = "50" slider = Slider(app, end="200") checkbox = CheckBox(app, text="tick box") combo = Combo(app, options=["first", "Second", "Third"]) app.display()
player_sel.bg = "#424242" player_sel.text_color = "white" player_sel.text_size=14 Box(app,width=10,height=5,grid=[0,0]) # second_message = Text(app, "Please select a drill: ", size=14, font="Calibri Bold", color="green",grid=[1,1,2,1]) # logo = Picture(app, image="include/images/logo.png", align="left", grid=[0,0]) # logo.resize(75, 75) # logoright = Picture(app, image="include/images/logo.png", align="left", grid=[3,0]) # logoright.resize(75, 75) button_width = 17 print('looping') drill_1 = PushButton(app, command=gui_app().staticDrill, args=[app] ,text="Basic Tracking", grid=[1,2],width=17) drill_1.width = button_width drill_1.font="Calibri Bold" drill_1.bg="#006868" drill_1.text_color="white" drill_1.text_size = 14 drill_2 = PushButton(app, command=gui_app().predictiveDrill,args=[app], text="Predictive Tracking",grid=[2,2],width=17) drill_2.width = button_width drill_2.font="Calibri Bold" drill_2.bg="#006868" drill_2.text_color="white" drill_2.text_size=14 drill_3 = PushButton(app, command=gui_app().manualDrill,args=[app], text="VC w/Basic Tracking",grid=[1,3],width=17) drill_3.width = button_width drill_3.font="Calibri Bold" drill_3.bg="#006868" drill_3.text_color="white" drill_3.text_size=14
youtube_box = Box(app, width="fill", align="top", border=False) youtube_box.bg = "#e74c3c" search_query_box = TextBox(youtube_box, width="fill", align="left", multiline=False) search_query_box.text_size = 25 search_query_box.bg = "#dfe6e9" search_button = PushButton(youtube_box, command=search_yt_query, text="Search YouTube", align="right", width=30, height=3) search_button.text_size = 20 search_button.text_color = "white" # Contains the buttons for executing system functions buttons_box = Box(app, width="fill", layout="grid", align="top", border=False) buttons_box.bg = "#3498db" buttons_box.text_color = "white" button13 = PushButton(buttons_box, command=launch_kodi, text="Launch KODI", grid=[0, 0], width=27, height=1) button13.text_size = 20 button13.when_clicked = highlight2 button13.when_mouse_leaves = lowlight2 button14 = PushButton(buttons_box,
users = cur.fetchall() con.commit() for i in range(0, len(users)): users[i] = ". ".join(str(x) for x in users[i]) ################# Main Window Elements ##################### app = App(title="Face Detection and Recognition", width="800") titleBox = Box(app, width="fill", align="top") pageTitle = Text(titleBox, text="Welcome to Face Detection and Recognition Project", color="blue", size=20) userEntryBtn = PushButton(app, command=showUserEntryWin, text="Add New User") userEntryBtn.bg = "red" userEntryBtn.text_size = 15 userEntryBtn.text_color = "#ffffff" faceRecogBtn = PushButton(app, command=showRecogWin, text="Recognize User") faceRecogBtn.bg = "green" faceRecogBtn.text_size = 15 faceRecogBtn.text_color = "#ffffff" ################### Add User Window Elements ############### entryWinTitleBox = Box(app, layout="grid", width="fill", align="top") addWinBackButton = PushButton(entryWinTitleBox, text="Go back", grid=[0, 0], command=showMainWin) entryPgTitle = Text(entryWinTitleBox, text="Add New User", color="blue", size=20,
def ende(x, y): if board[x, y].dotty == True: board[x, y].dotty = False board.set_pixel(x, y, "white") end = time.perf_counter() timeused = round((end - starttime) * 1000) / 1000 timedisplay = Text(app, text="Your reaction-time: " + str(timeused) + "s") timedisplay.text_color = "white" timedisplay.font = "Impact" board.update_command(ende) x, y = random.randint(0, 4), random.randint(0, 4) board[x, y].dotty = True board.set_pixel(x, y, "red") app = App(title="Reaktionstest") app.bg = "black" free = Text(app, text="\n\n\n\n\n\n") welcome_message = Text( app, text="Welcome to the reaction test. \nHere you can test your reaction.") welcome_message.text_color = "white" welcome_message.font = "Impact" free2 = Text(app, text="\n") button = PushButton(app, test, text="Start") button.text_color = "white" app.display()
g_input.text_color = "#1a53ff" b_label = Text(color_interface, text="B :", color="#1a53ff", size=15, grid=[0, 3]) b_input = TextBox(color_interface, grid=[1, 3]) b_input.bg = "#ff5c33" b_input.text_color = "#1a53ff" adjust_button = PushButton(color_interface, grid=[2, 4], width="20", text="Adjust", command=adjust_color) adjust_button.bg = "#002699" adjust_button.text_color = "white" # Air Quality Interface quality_header = Text(quality_interface, text="Air Quality Sensor", color="#002699", size=20, align="top") sensor_value = Text(quality_interface, text="TEST", color="#002699", size=120) status_text = Text(quality_interface, text="Status: OK", color="green", size=15, align="bottom") # Update the sensor value. sensor_value.repeat(1000, evaluateSensorValue)
# LeftBox listBoxTitle = Text(left_box, "All Work Orders", grid=[0,0], size=16, color="Dark Blue",\ font="Quicksand Medium") instructions = Text(left_box, "click to add boat to Today's List", grid=[0,1], color="Dark Blue") fullList = ListBox(left_box, items = boatlist, command = write_wo, width = 500, height = 345, grid=[0,2],\ scrollbar=True) fullList.bg = (200, 230, 255) fullList.text_size = 16 fullList.tk.children["!scrollbar"].config(width=25) # access the tkinter object to resize the scrollbar fullList._listbox.resize(None, None) # to show scrollbar, reset internal listbox size fullList._listbox.resize("fill", "fill") # now fill available space # Missing Name Button infobutton = PushButton(left_box, text = "Missing Name?", padx=5, command = info_button, align="bottom", grid=[0,3]) infobutton.text_color = "Dark Blue" infobutton.text_size = 14 infobutton.bg = (110, 170, 255) # RightBox todaysList = Text(right_box, text="Today's List", size=16, color="Dark Blue", font="Quicksand Medium") listInstruct = Text(right_box, text="click to remove boat from Today's List", color="Dark Blue") display = ListBox(right_box, items = todays_boats, command = delete_name ,\ width = 350, height = 345, scrollbar=True) display.bg = (200, 230, 255) display.text_size=16 display.tk.children["!scrollbar"].config(width=25) # access the tkinter object to resize the scrollbar display._listbox.resize(None, None) # to show scrollbar, reset internal listbox size display._listbox.resize("fill", "fill") # now fill available space finished = PushButton(right_box, text = "Finished", padx=50, command = close_window, align="bottom")
# GUI Setings app = App(bg ="lightgrey", title="Pimoroni Interactive Cam V1.5", width=1050, height=400, layout="grid") pan_txt = Text(app, text="R Pan L", width=17, grid=[1,0], align="left") pan_txt.text_color="blue" position_txt = Text(app, text="Postition", width=10, color="blue", grid=[0,1], align="left") pan_set = Slider(app, command=set_pan_tilt, start=-90, end=90, width=150, height=15, grid=[1,1], align="left") # sets pan value pan_set.value = 0 pan_set.bg="yellow" reset_position = PushButton(app, command=position_reset, text="Position Reset", width=14, grid=[2,1], align="left") reset_position.text_color="blue" tilt_txt = Text(app, text="U Tilt D", width=17, grid=[3,0], align="left") tilt_txt.text_color="blue" tilt_set = Slider(app, command=set_pan_tilt, start=-90, end=90, width=150, height=15, grid=[3,1], align="left") # sets tilt value tilt_set.value = -20 tilt_set.bg="yellow" lights_txt = Text(app, text="Lighting", width=10, color="blue", grid=[0,4], align="left") red_txt = Text(app, text=" RED", width=10, grid=[1,3], align="left") # red_txt.bg="lightgrey" green_txt = Text(app, text=" GREEN", width=10, grid=[2,3], align="left") green_txt.bg="lightgrey"
def be_different(): window = Window(app, title="OTHER", height="320", width="480", bg="mint cream", layout="grid") window.tk.attributes("-fullscreen", True) def play_techno(): get_files(directories[8], window) def play_classical(): get_files(directories[9], window) def play_jazz(): get_files(directories[10], window) def play_blues(): get_files(directories[11], window) def play_country(): get_files(directories[12], window) def play_folk(): get_files(directories[13], window) def play_latin(): get_files(directories[14], window) def play_new_age(): get_files(directories[15], window) def play_spiritual(): get_files(directories[16], window) def close_other(): window.hide() welcome_message = Text(window, text="Other Genres", size=24, font="Arial", color="dark slate gray", grid=[3, 0]) techno_button = PushButton(window, width=13, command=play_techno, text="Techno", grid=[1, 1]) techno_button.text_color = "dark slate gray" techno_button.text_size = "12" techno_button.font = "Arial" techno_button.bg = "white" classical_button = PushButton(window, width=13, height=2, command=play_classical, text="Classical", grid=[3, 1]) classical_button.text_color = "dark slate gray" classical_button.text_size = "12" classical_button.font = "Arial" classical_button.bg = "white" jazz_button = PushButton(window, width=13, command=play_jazz, text="Jazz", grid=[5, 1]) jazz_button.text_color = "dark slate gray" jazz_button.text_size = "12" jazz_button.font = "Arial" jazz_button.bg = "white" blues_button = PushButton(window, width=13, height=2, command=play_blues, text="Blues", grid=[1, 2]) blues_button.text_color = "dark slate gray" blues_button.text_size = "12" blues_button.font = "Arial" blues_button.bg = "white" country_button = PushButton(window, width=13, command=play_country, text="Country", grid=[3, 2]) country_button.text_color = "dark slate gray" country_button.text_size = "12" country_button.font = "Arial" country_button.bg = "white" folk_button = PushButton(window, width=13, height=2, command=play_folk, text="Folk", grid=[5, 2]) folk_button.text_color = "dark slate gray" folk_button.text_size = "12" folk_button.font = "Arial" folk_button.bg = "white" latin_button = PushButton(window, width=13, command=play_latin, text="Latin", grid=[1, 3]) latin_button.text_color = "dark slate gray" latin_button.text_size = "12" latin_button.font = "Arial" latin_button.bg = "white" new_age_button = PushButton(window, width=13, height=2, command=play_new_age, text="New Age", grid=[3, 3]) new_age_button.text_color = "dark slate gray" new_age_button.text_size = "12" new_age_button.font = "Arial" new_age_button.bg = "white" spiritual_button = PushButton(window, width=13, command=play_spiritual, text="Spiritual", grid=[5, 3]) spiritual_button.text_color = "dark slate gray" spiritual_button.text_size = "12" spiritual_button.font = "Arial" spiritual_button.bg = "white" close_other = PushButton(window, width=13, text="go back", command=close_other, grid=[5, 5]) close_other.text_color = "dark slate gray" close_other.text_size = "12" close_other.font = "Arial" close_other.bg = "white"
startBtn.height = 1 startBtn.text_size = 15 endBtnSpacer = Text(startScr, text=" ", size=25, align="bottom") endBtn = PushButton( startScr, text="Quit", command=windowClose, align="bottom", padx=0, pady=0, ) endBtn.width = 10 endBtn.height = 1 endBtn.text_color = "#ffffff" #white #SECOND WINDOW #TRIANGLE s0 = Window(startScr, title="Instructions", height=appH, width=appW, bg=appBG) s0.hide() #hides this window until player clicks on start button Text(s0, text="What is showing on the Bomb?", color="#ffffff", size=25) #colour: white Text(s0, text="", size=10) #spacer Text(s0, text=if_text) Text(s0, text="", size=10) #spacer Text(s0, text="Triangle", size=50) Text(s0, text="", size=10) #spacer Text(s0, text=instr) Text(s0, text="", size=15) #spacer Text(s0, text="Press the joystick 3 times", size=25)
command=time_add_button_clicked, text="+", grid=[3, 2], width=time_button_width, height=element_height) exit_button = PushButton(app, command=exit_button_clicked, text="X", grid=[3, 0], width=exit_button_size, height=exit_button_size, align="top") # Set buttons text size motor_button.text_size = font_size motor_button.text_color = text_color_default pump_button.text_size = font_size pump_button.text_color = text_color_default cancel_hold_button.text_size = font_size cancel_hold_button.text_color = text_color_default time_subs_button.text_size = font_size time_subs_button.text_color = text_color_default time_add_button.text_size = font_size time_add_button.text_color = text_color_default motor_text.text_color = text_color_inactive pump_text.text_color = text_color_inactive time_text.text_color = text_color_inactive parser = argparse.ArgumentParser() parser.add_argument("--dry", action="store_true",