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()
def getBanner(text): global banner if banner == None: app = App(title="Information") app.width = 1200 app.height = 1090 app.tk.attributes("-fullscreen", True) banner = TextBox(app, text=text, width="fill", height="fill", multiline=True, align="top") banner.text_size = 50 banner.text_color = "red" app.display() banner = None return banner
grid=[0, 3, 2, 1], 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)
arm_interface = Box(bottom, width=appWidth / 2, align="right") # RGB Color Interface color_header = Text(color_interface, text="Adjust RGB Background Color", color="#002699", size=20, grid=[0, 0]) r_label = Text(color_interface, text="R :", color="#1a53ff", size=15, grid=[0, 1]) r_input = TextBox(color_interface, grid=[1, 1]) r_input.bg = "#ff5c33" r_input.text_color = "#1a53ff" g_label = Text(color_interface, text="G :", color="#1a53ff", size=15, grid=[0, 2]) g_input = TextBox(color_interface, grid=[1, 2]) g_input.bg = "#ff5c33" 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"
#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()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(2) sIP = 0 sP = 0 app = App(bg="lightblue1", title="Multitriv Client", layout="grid", width=875, height=600) ippWindow = Window(app, title="Server details") inputLn = TextBox(app, grid=[0, 0], width=50) chatHist = TextBox(app, grid=[0, 1], height=29, width=110, multiline=True) ipBox = TextBox(app, grid=[0, 2], width=10, text="IP Address") portBox = TextBox(app, grid=[0, 3], width=10, text="Port") chatHist.text_color = "maroon" inputLn.text_color = "maroon" chatHist.bg = "LightSteelBlue3" inputLn.bg = "LightSteelBlue3" ipBox.bg = "LightSteelBlue3" portBox.bg = "LightSteelBlue3" def sendMsg(args): #if(event_data.key == "<Return>"): msgContents = inputLn.value inputLn.clear() s.send(msgContents.encode('utf-8')) nick = str(input("Nickname?: "))
from guizero import App, ButtonGroup, CheckBox, Combo, PushButton, Slider, Text, TextBox a = App(title="colors") text = Text(a, text="colors") check = CheckBox(a, "check me") combo = Combo(a, ["red", "blue"]) button = PushButton(a) slider = Slider(a) textbox = TextBox(a, text="or colours") a.bg = "pink" text.text_size = 30 text.font = "verdana" check.bg = "red" combo.bg = "blue" combo.text_color = "green" combo.text_size = 24 button.bg = "black" button.text_color = "white" button.font = "arial" button.text_size = 18 slider.bg = "yellow" textbox.bg = "cyan" textbox.font = "courier" textbox.text_color = "purple" a.display()