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 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
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" a.text_color = (255, 253, 12)
grid=[3, 1]) welcome_message = Text(app, text="Press SAVE to save identified test results", size=15, font="Calibri", color="grey", bg="white", grid=[3, 3]) Spacer = Text(app, text=" ", size=50, bg="white", grid=[0, 4]) Result = Text(app, text=" ", size=200, font="Calibri", color='#F7515E', bg="white", grid=[3, 6]) analyse_results_button = PushButton(app, command=import_results, text="Anaslyse Results", grid=[1, 5]) save_button = PushButton(app, command=save, text="Save", grid=[5, 5]) analyse_results_button.text_size = 12 save_button.text_size = 12 analyse_results_button.font = "Calibri" save_button.font = "Calibri" app.display()
def show_playing(artist, song, files, directory, length): window = Window(app, title="Now Playing", height="320", width="480", bg="white") window.tk.attributes("-fullscreen", True) volume = pygame.mixer.music.get_volume() def next(): t.cancel() window.hide() playMusic(files, directory) t = Timer(length, next) t.start() def skip_track(): t.cancel() window.hide() playMusic(files, directory) def stop_track(): t.cancel() window.hide() pygame.mixer.music.stop() def increase_volume(): def max_invisible(): max_text.visible = False pygame.mixer.music.set_volume(pygame.mixer.music.get_volume() + 0.1) if pygame.mixer.music.get_volume() == 1.0: max_text.visible = True max_text.after(3000, max_invisible) def decrease_volume(): def min_invisible(): min_text.visible = False pygame.mixer.music.set_volume(pygame.mixer.music.get_volume() - 0.1) if pygame.mixer.music.get_volume() < 0.1: min_text.show() min_text.after(3000, min_invisible) def write_comment(): def comment_invisible(): comment_result_text.visible = False file_object = open('/home/pi/Desktop/musicboxcomments', 'a') file_object.write(str(datetime.datetime.now()) + "\n") file_object.write(comment_text.value) file_object.close() comment_result_text.show() comment_result_text.after(3000, comment_invisible) comment_text.value = "" get_comments() welcome_message = Text(window, text="--Current Track--", size=16, font="Courier New", color="black") artist_name = Text(window, text=artist, width="fill", height=2, size=14, font="Courier New", color="black") song_title = Text(window, text=song, width="fill", height=2, size=14, font="Courier New", color="black") stop_button = PushButton(window, width=75, height=75, image="/home/pi/Documents/Rideshare/stop.gif", command=stop_track, align="left") skip_button = PushButton(window, width=75, height=75, image="/home/pi/Documents/Rideshare/skip.gif", command=skip_track, align="right") volume_box = Box(window, width="fill", align="bottom", layout="grid") empty_space1 = Text(volume_box, text=" ", grid=[0, 0]) increase_button = PushButton( volume_box, width=40, height=40, image="/home/pi/Documents/Rideshare/increase.gif", command=increase_volume, grid=[3, 0]) empty_space2 = Text(volume_box, text=" ", grid=[2, 0]) decrease_button = PushButton( volume_box, width=40, height=40, image="/home/pi/Documents/Rideshare/decrease.gif", command=decrease_volume, grid=[1, 0]) max_text = Text(window, text="MAX", size=10, font="Courier New", visible=False, color="red", align="bottom") min_text = Text(window, text="MIN", size=10, font="Courier New", visible=False, color="red", align="bottom") comment_text = TextBox(window, width="20", multiline=True, height=2) comment_text_button = PushButton(window, command=write_comment, text="comment") comment_text_button.text_size = "8" comment_text_button.font = "Courier New" comment_result_text = Text(window, text="Comment saved. Thanks!", size=10, font="Courier New", visible=False, color="red", align="bottom")
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"
print(test.value) def exposure(): camera.exposure_compensation = expcomp.value def exposurereset(): expcomp.value = 0 test = TextBox(app, command=test, text="this is a pushbutton test") Preview = PushButton(app, command=preview, text="preview") Preview.font = "Times New Roman" Preview.text_color = "Red" Preview.height = "10" Preview.text_size = "15" StopPreview = PushButton(app, command=stop_preview, text="stop preview") shutter = PushButton(app, command=shutter, text="shutter") longexposurebutton = PushButton(app, command=longexposure, text="long exposure shutter")
] #-------------------------------------------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") other_button.text_color = "white" other_button.text_size = "12"
cyoBox.show() 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"
font="Cascadia Code") # Operation box operacao = TextBox(app, text="", width=24) numinserttitle = Text(app, text="Insert numbers below and press [New number]", color="#A0A0A0", font="Cascadia Code") # Number box numinsert = TextBox(app, text="0", width=24) spacera = Text(app, text="") # Spacer A newNumber = PushButton(app, numberAppend, text="New number") # New number button newNumber.bg = "#565656" newNumber.text_size = 13 newNumber.font = "Cascadia Code" spacerb = Text(app, text="") # Spacer B clear = PushButton(app, clearlist, text="Clear list") # Clear list button clear.bg = "#565656" clear.text_size = 13 clear.font = "Cascadia Code" spacerc = Text(app, text="") # Spacer C calculate = PushButton(app, calcular, text="Calculate") # "Calculate" calculate.bg = "#565656" calculate.text_size = 13 calculate.font = "Cascadia Code"
PP_button = PushButton(window_one, command=PP_temp, text="PP", grid=[13, 0]) LDPE_button = PushButton(window_one, command=LDPE_temp, text="LDPE", grid=[12, 0]) HDPE_button = PushButton(window_one, command=HDPE_temp, text="HDPE", grid=[11, 0]) ABS_button = PushButton(window_one, command=ABS_temp, text="ABS", grid=[10, 0]) PA_button = PushButton(window_one, command=PA_temp, text="PA", grid=[9, 0]) other_button = PushButton(window_one, command=Other_temp, text="Custom Temp", grid=[14, 0]) timer_button = PushButton(window_one, command=timer_func, text="10 Seconds", grid=[15, 0]) timer_button_two = PushButton(window_one, command=timer_func_two, text="15 Seconds", grid=[16, 0]) timer_button_three = PushButton(window_one, command=timer_func_three, text="20 Seconds", grid=[17, 0]) other_button_two = PushButton(window_one, command=Other_time, text="Custom Time", grid=[18, 0]) power_button = PushButton(window_one, command=power_off, text="Power Off", grid=[19, 0]) custom_button = PushButton(window_one, command=customp_window, text="Custom Profiles", grid=[20, 0]) # Style block for the buttons within the main window. PA_button.text_color = (255, 30, 30) PA_button.font = "verdana" PA_button.text_size = 6 PA_button.bg = "#300000" ABS_button.text_color = (255, 30, 30) ABS_button.font = "verdana" ABS_button.text_size = 6 ABS_button.bg = "#3A0000" HDPE_button.text_color = (255, 30, 30) HDPE_button.font = "verdana" HDPE_button.text_size = 6 HDPE_button.bg = "#440000" LDPE_button.text_color = (255, 30, 30) LDPE_button.font = "verdana" LDPE_button.text_size = 6 LDPE_button.bg = "#4E0000" PP_button.text_color = (255, 30, 30)
def __init__(self, app): self.app = app #------------------------------ Main Menu Window ------------------------------# # Menu containers from top to botton e.g container 1, 2, 3, 4, 5, 6, 7 menu_container_1 = Box(self.app, width=700, height=100) menu_container_2 = Box(self.app, width=700, height=100) menu_container_3 = Box(self.app, width=700, height=100) menu_container_4 = Box(self.app, width=700, height=100) menu_container_5 = Box(self.app, width=700, height=100) menu_container_6 = Box(self.app, width=700, height=100) menu_container_7 = Box(self.app, width=700, height=100) # button container number 1 filler_box_1 = Box(menu_container_2, align="top", width=700, height=20) button_1_container = Box(menu_container_2, align="bottom", width=170, height=55) filler_box_2 = Box(menu_container_2, align="bottom", width=700, height=20) # button container number 2 filler_box_3 = Box(menu_container_3, align="top", width=700, height=20) button_2_container = Box(menu_container_3, align="bottom", width=170, height=55) filler_box_4 = Box(menu_container_3, align="bottom", width=700, height=20) # button container number 3 filler_box_5 = Box(menu_container_4, align="top", width=700, height=20) button_3_container = Box(menu_container_4, align="bottom", width=170, height=55) filler_box_6 = Box(menu_container_4, align="bottom", width=700, height=20) # button container number 4 filler_box_7 = Box(menu_container_5, align="top", width=700, height=20) button_4_container = Box(menu_container_5, align="bottom", width=170, height=55) filler_box_8 = Box(menu_container_5, align="bottom", width=700, height=20) # button container number 5 filler_box_9 = Box(menu_container_6, align="top", width=700, height=20) button_5_container = Box(menu_container_6, align="bottom", width=170, height=55) filler_box_10 = Box(menu_container_6, align="bottom", width=700, height=20) #-------------------------------Main Menu Buttons----------------------------------# Mathematics = PushButton(button_1_container, text="Mathematics", width=100, height=60, align="bottom", command=self.mathematics) Mathematics.bg = "#7D7268" Mathematics.font = "sans-serif" Chemistry = PushButton(button_2_container, text="Chemistry", width=100, height=60, align="bottom", command=self.chemistry) Chemistry.bg = "#54C03D" Chemistry.font = "sans-serif" Geography = PushButton(button_3_container, text="Geography", width=100, height=60, align="bottom", command=self.geography) Geography.bg = "#449BB0" Geography.font = "sans-serif" English = PushButton(button_4_container, text="English", width=100, height=60, align="bottom", command=self.english) English.bg = "#FEAD5F" English.font = "sans-serif" UltimateTest = PushButton(button_5_container, text="Ultimate Test", width=100, height=60, align="bottom", command=self.ultimate) UltimateTest.bg = "#DB4692" UltimateTest.font = "sans-serif"
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"
welcome_message = Text(app, "Welcome to S.T.A.R.S.", size=20, font="Calibri Bold", color="red", grid=[1,0,2,1]) player_sel = Combo(app,options=["Player1","Player2","Player3","Player4","Player5"],command=gui_app().player_selection,grid=[1,1,2,1]) 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"
font="Free Mono") welcomeBox = Box(app, border=0, align="top") prisonmike = Picture(welcomeBox, image="prisonmike.gif", align="top") #buttons buttonBox = Box(app, width="fill", align="bottom") insultButton = PushButton(buttonBox, text="Generate Insult", command=insult, align="bottom") insultButton.text_size = 15 insultButton.font = "Free Mono" insultButton.bg = "firebrick3" insultButton.text_color = "snow" moreInsults = PushButton(buttonBox, text="Get another insult", command=moreInsult, align="left") moreInsults.text_size = 13 moreInsults.font = "Free Mono" moreInsults.hide() createInsults = PushButton(buttonBox, text="Create your own insults", command=cyo, align="right")