def get_barcodes(parent, commands): global scan_in_barcode scan_in_barcode = TextBox(parent, width=22, grid=[1, 2, 2, 1], align='left') scan_in_barcode.text_color = display_config.text_color scan_in_barcode.font = display_config.text_font scan_in_barcode.text_size = display_config.text_size scan_in_barcode.when_key_pressed = commands[0] global scan_out_barcode scan_out_barcode = TextBox(parent, width=22, grid=[1, 2, 2, 1], align='left') scan_out_barcode.text_color = display_config.text_color scan_out_barcode.font = display_config.text_font scan_out_barcode.text_size = display_config.text_size scan_out_barcode.when_key_pressed = commands[1] global look_up_barcode look_up_barcode = TextBox(parent, width=22, grid=[1, 2, 2, 1], align='left') look_up_barcode.text_color = display_config.text_color look_up_barcode.font = display_config.text_font look_up_barcode.text_size = display_config.text_size look_up_barcode.when_key_pressed = commands[2]
def spin_up_editable_texts(parent, command): texts = [] global item_name_text item_name_text = Text(parent, width='fill', color=display_config.text_color, font=display_config.text_font, size=display_config.text_size, grid=[2, 3], align='left') global item_quantity_text item_quantity_text = Text(parent, width='fill', color=display_config.text_color, font=display_config.text_font, size=display_config.text_size, grid=[2, 4], align='left') global item_size_text item_size_text = Text(parent, width='fill', color=display_config.text_color, font=display_config.text_font, size=display_config.text_size, grid=[2, 5], align='left') global item_name_text_box item_name_text_box = TextBox(parent, width=45, grid=[2, 3, 2, 1], align='left') item_name_text_box.text_color = display_config.text_color item_name_text_box.font = display_config.text_font item_name_text_box.text_size = display_config.text_size item_name_text_box.when_clicked = command global item_quantity_text_box item_quantity_text_box = TextBox(parent, width=10, grid=[2, 4], align='left') item_quantity_text_box.text_color = display_config.text_color item_quantity_text_box.font = display_config.text_font item_quantity_text_box.text_size = display_config.text_size item_quantity_text_box.when_clicked = command global item_size_text_box item_size_text_box = TextBox(parent, width=10, grid=[2, 5], align='left') item_size_text_box.text_color = display_config.text_color item_size_text_box.font = display_config.text_font item_size_text_box.text_size = display_config.text_size item_size_text_box.when_clicked = command
def init_widgets(): global app, Weather_drawing, Add_textbox, To_do_list_Title, Addbutton, delbutton, Clearbutton, Citybutton To_do_list_Title = Text(app, "To-do List:", size=20, color="light gray", grid=[0,2,1,1],align="left") create_list() Add_textbox=TextBox(app,grid=[0,4,1,1],width=50, align="left") Add_textbox.text_size=12 Add_textbox.text_color="Black" Add_textbox.font="Century Gothic Bold" Add_textbox.bg="white" Addbutton = PushButton(app, command=addto_todolist, image="Images/add_button.png", grid=[0,4,1,1],align="right") delbutton = PushButton(app, command=delfrom_todolist, image="Images/sub_button.png", grid=[1,4,4,1],align="right") Clearbutton = PushButton(app, command=clear_todolist, image="Images/clear_button.png", grid=[0,5], width=100, height=50, align="left") Clearbutton.bg = "light gray" Citybutton = PushButton(app, command=change_city, image="Images/Change_city_button.png", grid=[0,5], width=160, height=50) Citybutton.bg = "light gray" Weather_drawing = Drawing(app,grid=[0,6,2,1],align="left",width=600,height=300) weather_font_color = which_color(description) Image_picture = which_image(description) update_weather() Weather_drawing.image(0,0,image="Images/" + Image_picture, width=600,height=400) city_num_x = 200 - (len(city_name)*10) city_num_y = 0 Weather_drawing.text(city_num_x,city_num_y, text= city_name, color=weather_font_color,font="Arial",size=40) Weather_drawing.text(135 - len(temp),45, text= temp, color=weather_font_color,font="Arial",size=50) Weather_drawing.text(110 - len(temp),110, text= "Low:" + temp_min, color=weather_font_color,font="Arial",size=15) Weather_drawing.text(225 - len(temp) + len(temp_high)*2,110, text= "High:" + temp_high, color=weather_font_color,font="Arial",size=15) Weather_drawing.text(150 - len(humidity),135, text= "Humidity: " + humidity, color=weather_font_color,font="Arial",size=15) Weather_drawing.text(125 - len(wind_speed),155, text= "Wind Speed: " + wind_speed, color=weather_font_color,font="Arial",size=15) Add_textbox.when_clicked = Make_keys
def change_city(): global app global window global Display_list, Weather_drawing, Add_textbox, To_do_list_Title, Addbutton, delbutton, Clearbutton, Citybutton, Spotifybutton def Confirm_city(): global city_name if (City_name_entry_textbox.value): city_name = City_name_entry_textbox.value f = open("Weather_loc.txt", "w") f.write(city_name) f.close() Confirmbutton.destroy() City_name_entry_textbox.destroy() City_name_ask_title.destroy() Destroy_keys() init_widgets() if (keys_exist == 1): Destroy_keys() To_do_list_Title.destroy() Add_textbox.destroy() Addbutton.destroy() delbutton.destroy() Citybutton.destroy() Spotifybutton.destroy() Display_list.destroy() Clearbutton.destroy() Weather_drawing.destroy() City_name_ask_title = Text(app, "Type the name of a city:", size=35, font="Century Gothic Bold", color="light gray", grid=[0, 2, 2, 1], align="left") City_name_entry_textbox = TextBox(app, grid=[0, 3], width=50) City_name_entry_textbox.text_size = 12 City_name_entry_textbox.text_color = "Black" City_name_entry_textbox.font = "Century Gothic Bold" City_name_entry_textbox.bg = "white" City_name_entry_textbox.when_clicked = Make_keys Confirmbutton = PushButton(app, command=Confirm_city, image="Images/Confirm.png", grid=[0, 4], width=120, height=50) Confirmbutton.bg = "light gray" app.focus()
align="left") Display_list.text_color = "light gray" Display_list.text_size = 20 Display_list.font = "Century Gothic Bold" #Create New list create_list() #Text box for typing ######################################################################################################### global Add_textbox Add_textbox = TextBox(app, grid=[0, 4, 1, 1], width=50, align="left") Add_textbox.text_size = 12 Add_textbox.text_color = "Black" Add_textbox.font = "Century Gothic Bold" Add_textbox.bg = "white" #Add button and add function ######################################################################################################### def addto_todolist(): global Display_list global Todolist global Add_textbox if (Add_textbox.value): f = open("Todolist.txt", "a") f.write(Add_textbox.value + "\n") f.close() Todolist.append(Add_textbox.value) Display_list.append(Add_textbox.value)
width="10", text=k, pady=resolution[rt]['button_pady']) btn.bg = "#F84446" counter += 1 btn_list.append(btn) title_box = Box(app, width="fill", align="top", border=True) text_box = TextBox(title_box, text="Copy paste text here and hit ANALYZE", width="100", height="5", multiline='True') text_box.font = "Corbel" text_box.text_size = resolution[rt]['select_box'] preprocess_checkbox = CheckBox(app, text="Analyze Raw Data", command=analyze) analyzebutton = PushButton(title_box, text="Analyze") analyzebutton.when_clicked = analyze button_box_r1 = Box(app, align="top", border=True) button_box_r2 = Box(app, align="top", border=True) button_box_r3 = Box(app, align="top", border=True) button_box_r4 = Box(app, align="top", border=True) button_box_r5 = Box(app, align="top", border=True) button_box_r6 = Box(app, align="top", border=True) button_box_r7 = Box(app, align="top", border=True) button_box_r8 = Box(app, align="top", border=True)
#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) b.text_color = "purple" b.text_size = 18 a.display()
divider_x = Text(box, text="", grid=[1, 0]) divider_x.width = 10 divider_x.font = 'Source code pro' temp_label = Text(box, text="Temperature", grid=[1, 1], font='Source code pro') ph_label = Text(box, text="PH", grid=[2, 1]) oxygen_label = Text(box, text="Oxygen", grid=[3, 1], font='Source code pro') temp_label.width = 15 ph_label.width = 15 oxygen_label.width = 15 temp_th = TextBox(box, text="0", grid=[1, 2]) ph_th = TextBox(box, text="0", grid=[2, 2]) dox_th = TextBox(box, text="0", grid=[3, 2]) temp_th.width = 10 temp_th.font = 'Source code pro' ph_th.width = 10 ph_th.font = 'Source code pro' dox_th.width = 10 dox_th.font = 'Source code pro' divider = Text(box, text="", grid=[1, 3]) divider.width = 10 divider.font = 'Source code pro' temp_led = PushButton(box, text='', grid=[1, 4]) ph_led = PushButton(box, text='', grid=[2, 4]) dox_led = PushButton(box, text='', grid=[3, 4]) temp_led.width = 2 ph_led.width = 2 dox_led.width = 2