def drill_4_selection(): second_message.value = "Predictive Passing Selected" window4 = Window(app, bg="darkgreen") welcome_message4 = Text(window4, "Predictive Passing Parameters", size=25, font="Times New Roman", color="black") start_4 = PushButton(window4, command=powerON, text="Start") pause_4 = PushButton(window4, command=powerON, text="Pause") start_4.width = 30 start_4.bg = "gray" pause_4.width = 30 pause_4.bg = "gray" #second_message4 = Text(window4, "How many targets would you like to use?", size=15, font="Times New Roman", color="black") #targets = Slider(window4, command=print("Okay"), start=1, end=4) third_message4 = Text(window4, "Please select a passing speed:", size=15, font="Times New Roman", color="black") ball_speed4 = Slider(window4, command=print("Okay"), start=1, end=10) ball_speed4.width = 300
def Run(): global startWindow global finalCheck global startButtons startWindow = Window(app, title="Starting Screen", layout="grid") startWindow.width = 360; startWindow.height = 630; startWindow.bg = "Lime" playersQuestionText = Text(startWindow, text="How Many Players?", grid=[0, 0], align="top") playersQuestionText.text_size = 25 playerButtonContainer = Box(startWindow, layout="grid", grid=[0, 1], align="top", border=True) playerButtonContainer.set_border(10, "Lime") buttonOnePlayer = PushButton(playerButtonContainer, text="1 Player", grid=[1, 0], command=lambda: SetPlayerNumber(True, "1 Player")) buttonOnePlayer.width = 20; buttonOnePlayer.height = 10; buttonOnePlayer.bg = "White" buttonTwoPlayer = PushButton(playerButtonContainer, text="2 Player", grid=[2, 0], command=lambda: SetPlayerNumber(False, "2 Player")) buttonTwoPlayer.width = 20; buttonTwoPlayer.height = 10; buttonTwoPlayer.bg = "White" gameModeQuestionText = Text(startWindow, text="What Game Mode?", grid=[0, 2], align="top") gameModeQuestionText.text_size = 25 gameModeButtonContainer = Box(startWindow, layout="grid", grid=[0, 3], align="top", border=True) gameModeButtonContainer.set_border(10, "Lime") buttonAddition = PushButton(gameModeButtonContainer, text="Addition", grid=[1, 0], command=lambda: SetGameMode(True, "Addition")) buttonAddition.width = 20; buttonAddition.height = 10; buttonAddition.bg = "White" buttonSubtraction = PushButton(gameModeButtonContainer, text="Subtraction", grid=[2, 0], command=lambda: SetGameMode(False, "Subtraction")) buttonSubtraction.width = 20; buttonSubtraction.height = 10; buttonSubtraction.bg = "White" finalCheck = Box(startWindow, layout="grid", grid=[0, 4], align="top", border=True) finalCheck.set_border(10, "Lime") startButton = PushButton(finalCheck, text="Start!", grid=[0, 2], align="top", command=StartGame) startButton.width = 20; startButton.height = 5; startButton.bg = "White"; startButton.disable()
def StartOnePlayer(): global onePlayerWindow global drawButtonOnePlayer global cardImagesOnePlayer global guessContainerOnePlayer global guessCheckButtonOnePlayer global guessTextBoxOnePlayer global correctOnePlayer global errorTextOnePlayer onePlayerWindow = Window(app, title="One Player Game", layout="grid") onePlayerWindow.width = 320; onePlayerWindow.height = 560; onePlayerWindow.bg = "Lime" drawButtonOnePlayer = PushButton(onePlayerWindow, text="Draw!", grid=[0, 0], align="top", command=ButtonSwapOnePlayer) drawButtonOnePlayer.width = 20; drawButtonOnePlayer.height = 5; drawButtonOnePlayer.bg = "White" cardImagesOnePlayer = Box(onePlayerWindow, layout="grid", grid=[0, 1], align="top", border=True) cardImagesOnePlayer.set_border(10, "Lime") guessContainerOnePlayer = Box(onePlayerWindow, layout="grid", grid=[0, 2], align="top", border=True) guessContainerOnePlayer.set_border(10, "Lime") guessTextBoxOnePlayer = TextBox(guessContainerOnePlayer, grid=[0, 0], align="top") guessTextBoxOnePlayer.text_size = 20; guessTextBoxOnePlayer.bg = "White"; guessTextBoxOnePlayer.disable(); guessCheckButtonOnePlayer = PushButton(guessContainerOnePlayer, text="Check!", grid=[0, 1], align="top", command=CheckValuesOnePlayer) guessCheckButtonOnePlayer.width = 20; guessCheckButtonOnePlayer.height = 5; guessCheckButtonOnePlayer.bg = "White"; guessCheckButtonOnePlayer.disable(); pointsTextOnePlayer = Text(guessContainerOnePlayer, text="Score: ", grid=[0, 2], align="top") correctOnePlayer = Text(onePlayerWindow, text="", grid=[0, 3]) errorTextOnePlayer = Text(onePlayerWindow, text="Please enter a number!", grid=[0, 4]) errorTextOnePlayer.hide()
def drill_1_selection(): second_message.value = "Target Drill Selected" window1 = Window(app, bg="darkgreen") welcome_message1 = Text(window1, "Target Drill Parameters", size=25, font="Times New Roman", color="black") start_1 = PushButton(window1, command=drill_1_selection, text="Start") pause_1 = PushButton(window1, command=drill_2_selection, text="Pause") start_1.width = 30 start_1.bg = "gray" pause_1.width = 30 pause_1.bg = "gray" second_message1 = Text(window1, "How many targets would you like to use?", size=15, font="Times New Roman", color="black") targets = Slider(window1, command=print("Okay"), start=1, end=4) third_message1 = Text(window1, "Please select a passing speed:", size=15, font="Times New Roman", color="black") ball_speed = Slider(window1, command=print("Okay"), start=1, end=10) ball_speed.width = 300
def CustomLiveCollection(): customInformationWindow = Window(app, title="Custom Information Entry", layout="grid") customInformationWindow.width = 450 customInformationWindow.height = 180 customInformationWindow.bg = "Grey" usageText = Text(customInformationWindow, text="Enter the number of cycles you wish to run for...", grid=[0, 0], align="top") usageText.text_size = 15 informationText = Text(customInformationWindow, text="1 Cycle = 10 seconds", grid=[0, 1], align="top") valueTextBox = TextBox(customInformationWindow, grid=[0, 2], align="top") valueTextBox.width = 6 valueTextBox.bg = "White" beginButton = PushButton( customInformationWindow, text="Begin...", grid=[0, 3], align="top", command=lambda: LiveCollection(valueTextBox.value)) beginButton.width = 15 beginButton.height = 5 beginButton.bg = "White"
def manualDrill(): second_message.value = "Entering Manual Mode" STARS_aPP.drillType = "manual" window3 = Window(app, bg="darkgreen") welcome_message3 = Text(window3, "Manual Mode Controls", size=25, font="Times New Roman", color="black") third_message3 = Text(window3, "Please select a ball speed:", size=15, font="Times New Roman", color="black") speed = Slider(window3, command=STARS_aPP.ball_speed_slider, start=1, end=5) speed.width = 300 start_3 = PushButton(window3, command=STARS_aPP.start_command, args = [STARS_aPP.ballSpeed , STARS_aPP.difficulty, STARS_aPP.drillType], text="Begin") stop_3 = PushButton(window3, command=STARS_aPP.stop_command, text="stop") start_3.width = 30 start_3.bg = "gray" stop_3.width = 30 stop_3.bg = "gray"
def StartTwoPlayer(): global twoPlayerWindow global drawButtonTwoPlayer global cardImagesTwoPlayer1 global cardImagesTwoPlayer2 global guessContainerTwoPlayer1 global guessContainerTwoPlayer2 global guessTextBoxTwoPlayer1 global guessTextBoxTwoPlayer2 global guessCheckButtonTwoPlayer global correctTwoPlayer1 global correctTwoPlayer2 global errorTextTwoPlayer twoPlayerWindow = Window(app, title="Two Player Game", layout="grid") twoPlayerWindow.width = 660; twoPlayerWindow.height = 570; twoPlayerWindow.bg = "Lime" drawButtonTwoPlayer = PushButton(twoPlayerWindow, text="Draw!", grid=[0, 0], align="top", padx=20, command=ButtonSwapTwoPlayer) drawButtonTwoPlayer.width = 20; drawButtonTwoPlayer.height = 5; drawButtonTwoPlayer.bg = "White" cardImagesTwoPlayer1 = Box(twoPlayerWindow, layout="grid", grid=[0, 1], align="top", border=True) cardImagesTwoPlayer1.set_border(5, "Lime") cardImagesTwoPlayer2 = Box(twoPlayerWindow, layout="grid", grid=[1, 1], align="top", border=True) cardImagesTwoPlayer2.set_border(5, "Lime") guessContainerTwoPlayer1 = Box(twoPlayerWindow, layout="grid", grid=[0, 2], align="top", border=True) guessContainerTwoPlayer1.set_border(10, "Lime") guessTextBoxTwoPlayer1 = TextBox(guessContainerTwoPlayer1, grid=[0, 0], align="top") guessTextBoxTwoPlayer1.text_size = 20; guessTextBoxTwoPlayer1.bg = "White"; guessTextBoxTwoPlayer1.disable() guessContainerTwoPlayer2 = Box(twoPlayerWindow, layout="grid", grid=[1, 2], align="top", border=True) guessContainerTwoPlayer2.set_border(10, "Lime") guessTextBoxTwoPlayer2 = TextBox(guessContainerTwoPlayer2, grid=[0, 0], align="top") guessTextBoxTwoPlayer2.text_size = 20; guessTextBoxTwoPlayer2.bg = "White"; guessTextBoxTwoPlayer2.disable() pointsTextTwoPlayer1 = Text(guessContainerTwoPlayer1, text="Player One Score: ", grid=[0, 2], align="top") pointsTextTwoPlayer2 = Text(guessContainerTwoPlayer2, text="Player Two Score: ", grid=[0, 2], align="top") guessCheckButtonTwoPlayer = PushButton(twoPlayerWindow, text="Check!", grid=[0, 3], align="top", command=CheckValuesTwoPlayer) guessCheckButtonTwoPlayer.width = 20; guessCheckButtonTwoPlayer.height = 5; guessCheckButtonTwoPlayer.bg = "White"; guessCheckButtonTwoPlayer.disable() correctTwoPlayer1 = Text(guessContainerTwoPlayer1, text="", grid=[0, 3]) correctTwoPlayer2 = Text(guessContainerTwoPlayer2, text="", grid=[0, 3]) errorTextTwoPlayer = Text(twoPlayerWindow, text="Please Enter a Number!", grid=[0, 4]) errorTextTwoPlayer.hide()
def predictiveDrill(): second_message.value = "Entering Predictive Passing Mode" STARS_aPP.drillType = "dynamic" window2 = Window(app, bg="darkgreen") welcome_message2 = Text(window2, "Predictive Passing Controls", size=25, font="Times New Roman", color="black") third_message2 = Text(window2, "Please select a ball speed:", size=15, font="Times New Roman", color="black") speed = Slider(window2, command=STARS_aPP.ball_speed_slider, start=1, end=5) speed.width = 300 final_message1 = Text(window2, "Please select a difficulty:", size=15, font="Times New Roman", color="black") difficulty = Slider(window2, command=STARS_aPP.difficulty_slider, start=1, end=5) difficulty.width = 300 args = 1 start_2 = PushButton(window2, command=STARS_aPP.start_command, args = [STARS_aPP.ballSpeed , STARS_aPP.difficulty, STARS_aPP.drillType], text="Begin") stop_2 = PushButton(window2, command=STARS_aPP.stop_command, text="stop") start_2.width = 30 start_2.bg = "gray" stop_2.width = 30 stop_2.bg = "gray"
def staticDrill(): second_message.value = "Static Passing Selected" STARS_aPP.drillType = "static" window1 = Window(app, bg="darkgreen") welcome_message2 = Text(window1, "Static Passing Parameters", size=25, font="Times New Roman", color="black") third_message1 = Text(window1, "Please select a passing speed:", size=15, font="Times New Roman", color="black") speed = Slider(window1, command=STARS_aPP.ball_speed_slider, start=1, end=5) speed.width = 300 final_message1 = Text(window1, "Please select a difficulty:", size=15, font="Times New Roman", color="black") difficulty = Slider(window1, command=STARS_aPP.difficulty_slider, start=1, end=5) difficulty.width = 300 start_1 = PushButton(window1, command=STARS_aPP.start_command, args = [STARS_aPP.ballSpeed , STARS_aPP.difficulty, STARS_aPP.drillType], text="Begin") stop_1 = PushButton(window1, command=STARS_aPP.stop_command, text="stop") start_1.width = 30 start_1.bg = "gray" stop_1.width = 30 stop_1.bg = "gray"
def showBoard(): global board, tileButtonDict, tileList, gameBoard, difficulty createGame(difficulty) rowLabelCount = 0 columnLabelCount = 0 if len(tileList) > 256: rowLength = int(len(tileList)/16) else: rowLength = math.sqrt(len(tileList)) rowCount = 0 columnCount = 0 for tile in tileList: if not tile.isMined: surroundingMines = Text(board, text=str(tile.surroundingMineCount), grid=[columnCount,rowCount]) surroundingMines.height = 2 surroundingMines.width = 3 textDict[tile.label] = surroundingMines else: picture = Picture(board, image='bomb2.jpg', grid=[columnCount,rowCount]) picture.height = 25 picture.width = 15 mineDict[tile.label] = picture tileButton = PushButton(board, command=playGame, image = 'blank.jpg' , args=[tile], grid=[columnCount,rowCount], text='')#str(tile)#.isMined))#str(tile)) tileButton.bg = 'gray60' #print ('button grid', tileButton.grid) tileButton.when_right_button_pressed = markTile tileButton.width = 32 tileButton.height = 37 tileButtonDict[tile.label] = tileButton columnCount += 1 if columnCount == rowLength: rowCount += 1 columnCount = 0
def setup_board(): pictures = [] buttons = [] for x in range(0, 3): for y in range(0, 3): picture = Picture(picture_grid, image=get_random_sprite(), grid=[x, y]) picture.bg = "royal blue" picture.tk.config(height=100) picture.tk.config(width=100) pictures.append(picture) button_number = 0 for x in range(0, 3): for y in range(0, 3): button = PushButton(button_grid, command=match, args=[False], grid=[x, y]) button.width = 100 button.height = 100 button.icon(get_random_sprite()) button.bg = "dodger blue" button_number += 1 buttons.append(button) chosen_one = get_random_sprite() winning_button = randint(0, 8) buttons[winning_button].icon(chosen_one) buttons[winning_button].update_command(match, args=[True]) pictures[randint(0, 8)].value = chosen_one app.display()
file = open("calib_wavelength.txt", "r") calib_wavelength_ = file.read() wavelength = TextBox(app, text=calib_wavelength_) file.close() else: wavelength = TextBox(app, text="wavelength") button1 = PushButton(app, command=test_calibrate, text="Calibrate") button2 = PushButton(app, command=test_spectrometer, text="Spectrometer") button3 = PushButton(app, command=test_camera, text="Camera ") button4 = PushButton(app, command=test_servo, text="Servo ") button5 = PushButton(app, command=test_heater, text="Thermal Control") button6 = PushButton(app, command=test_serial, text="Serial ") button7 = PushButton(app, command=test_simulation, text="Run Simulation") button1.width = 12 button2.width = 12 button3.width = 12 button4.width = 12 button5.width = 12 button6.width = 12 button7.width = 12 button1.padding(5, 5) button2.padding(5, 5) button3.padding(5, 5) button4.padding(5, 5) button5.padding(5, 5) button6.padding(5, 5) button7.padding(5, 5)
startBtnSpacer = Text( startScr, text=" ", size=50, ) startBtn = PushButton( startScr, text="Start Game", command=gotoScreen0, padx=0, pady=0, ) startBtn.bg = "#e0e0e0" #light grey startBtn.width = 25 startBtn.height = 1 startBtn.text_size = 15 Text(startScr, text=" ", size=5) howToBtn = PushButton( startScr, text="How to Play", command=howTo, padx=0, pady=0, ) howToBtn.bg = "#e0e0e0" #light grey howToBtn.width = 25 howToBtn.height = 1
third_message3 = Text(window3, "Please select a ball speed:", size=15, font="Times New Roman", color="black") speed = Slider(window3, command=STARS_aPP.ball_speed_slider, start=1, end=5) speed.width = 300 start_3 = PushButton(window3, command=STARS_aPP.start_command, args = [STARS_aPP.ballSpeed , STARS_aPP.difficulty, STARS_aPP.drillType], text="Begin") stop_3 = PushButton(window3, command=STARS_aPP.stop_command, text="stop") start_3.width = 30 start_3.bg = "gray" stop_3.width = 30 stop_3.bg = "gray" ##_____Code that gets run:__________## #help(STEREOMAINFILE_Server) app = App(title="S.T.A.R.S. User Interface") welcome_message = Text(app, "Welcome to S.T.A.R.S.", size=20, font="Times New Roman", color="red") second_message = Text(app, "Let's play some soccer!", size=13, font="Times New Roman", color="darkgreen") logo = Picture(app, image="logo.gif", align = "left") logo.resize(200,200) drill_1 = PushButton(app, command=STARS_aPP.staticDrill, text="Static Passing") drill_1.width = 30 drill_2 = PushButton(app, command=STARS_aPP.predictiveDrill, text="Predictive Passing") drill_2.width = 30 drill_3 = PushButton(app, command=STARS_aPP.manualDrill, text="Manual Mode") drill_3.width = 30 app.display()
from guizero import App, Text, TextBox, PushButton app = App(title='HelloWorld!!') hello_text = Text(app, text='HelloWorld!!', font='Helvetica', size=60) whatever = TextBox(app, width=50, multiline=True, height=5) whatever.value = 'Something Cool' button = PushButton(app, text='Push Me!!') button.width = 6 button.height = 3 app.display()
startBtnSpacer = Text( startScr, text=" ", size=50, ) startBtn = PushButton( startScr, text="Start Game", command=gotoScreen0, padx=0, pady=0, ) startBtn.bg = "#e0e0e0" #light grey startBtn.width = 25 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
from guizero import App, Picture, PushButton, info app = App() anim = Picture(app, "guizero_flash.gif") anim.width = 200 anim.height = 100 button = PushButton(app, command=info, args=["button", "you pushed the image"], image="guizero_flash.gif") button.width = 200 button.height = 100 app.display()
app = App(title="James' Cocktail Cabinet", width=800, height=480) # The main menu page menu = Box(app, layout="grid") message = Text(menu, text="What drink would you like to make?", grid=[ 0, 0, 5, 1, ], align="left", size="36") agua = PushButton(menu, command=valencia, text="Agua da Valencia", grid=[0, 1]) agua.width = 15 bubbly = PushButton(menu, command=jack, text="Bubbly Jack Rose", grid=[1, 1]) bubbly.width = 15 champs = PushButton(menu, command=elysee, text="Champs Elysee", grid=[2, 1]) champs.width = 15 corpse = PushButton(menu, command=revive, text="Corpse Reviver No 2", grid=[3, 1]) corpse.width = 15 martini = PushButton(menu, command=drymartini, text="Dry Martini", grid=[4, 1]) martini.width = 15 espresso = PushButton(menu, command=coffee, text="Espresso Martini", grid=[0, 2])
get_venvs.bg = btn_bg box = Box(app, grid=[1, 2], height=15, width='fill') # List box venv_list = ListBox(app, align='left', grid=[1, 3], height=400, width=250) venv_list.text_size = 14 venv_list.bg = 'white' box = Box(app, grid=[1, 4], height=15, width='fill') # Activate venv button activate = PushButton(app, activate_venv, text='Activate', grid=[1, 5], align='left') activate.text_size = 14 activate.bg = btn_bg activate.width = 8 # Delete venv button delete = PushButton(app, delete_venv, text='Delete', grid=[1, 5], align='right') delete.text_size = 14 delete.bg = btn_bg delete.width = 8 """Center padding""" box = Box(app, grid=[2, 1], height='fill', width=30) """Right content""" new_label = Text(app, text='New VENV Name:', grid=[3, 1]) # New venv name texxt input new_venv_name = TextBox(app, grid=[3, 2], width=20)
] last_names = [ "Spindelshanks", "Mysterioso", "Dungeon", "Catseye", "Darkmeyer", "Flamingobreath", "the Furious" ] spy_name = choice(first_names) + " " + choice(last_names) # print(spy_name) name.value = spy_name #app app = App("TOP SECRET!") app.height = 350 #widgets title = Text(app, "Push the red button to find out your spy name") title.font = "Monospace" title.text_size = 14 button = PushButton(app, choose_name, text="Tell me!") button.text_size = 25 button.width = 10 button.height = 5 button.bg = "red" name = Text(app, text=" ") name.text_size = 20 name.font = "Times New Roman" #display app.display()
app = App(title="Aquarium GUI", width=800, height=400, layout="grid") # Build the data display grid data_boxes = [] for r_idx, row in enumerate(data_types): cols = [] for c_idx, col in enumerate(row): bx = Box(app, grid=[c_idx, r_idx]) txt_label = Text(bx, text=col) txt_label.size = label_size pb = PushButton(bx, text='') pb.text_size = data_size pb.height = 2 pb.width = 8 pb.bg = (225, 225, 225) # if col == 'Laser On': # pb.update_command(toggle_laser) # if col == 'Recording': # pb.update_command(toggle_recording) cols.append(pb) data_boxes.append(cols) logo = Picture(app, image="/home/pi/aquariumController/logoSmall.gif", grid=[4, 0]) # Add a ticker at the bottom of the app tkr = Text(app, text='System: ', grid=[0, 3, 4, 1]) tkr.size = 18
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 Turtle_button.height = 10 Stop_button = PushButton(app, command=Stop, text="Stop") Stop_button.width = 20 Stop_button.height = 10 app.display() #while True: # instruction = input("Type in f or b or s") # # if instruction == "f": # speed = float(input("Type in the speed you want")) # robot.forward(speed) #elif instruction == "s":
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"
text="Tequila", command=pour_tequila) rum_button = PushButton(ingredient_box, grid=[1, 0], align="top", text="Rum", command=pour_rum) vodka_button = PushButton(ingredient_box, grid=[2, 0], align="top", text="Vodka", command=pour_vodka) vodka_button.height = 10 vodka_button.width = 30 ## Button Box Setup button_one = PushButton(button_box, command=go_to_page, args=[1], text="<", grid=[0, 0]) button_two = PushButton(button_box, command=go_to_page, args=[2], text=">", grid=[1, 0]) raw_button = PushButton(button_box, command=go_to_page, args=[-1],
#title=Text(app, text=" Inlet Solar Weighing Golden Rubber Indonesia", size=20) #title.bg = (255,255,255) space2 = Text(app, text=" xxx", size=5) space2.text_color = "white" text_totalizer = Text(app, text="Jumlah Solar Didalam Tangki (liter)", size=30, grid=(1, 0, 1, 1)) totalizerVal = Text(app, text="0", size=140) button_pengisian = PushButton(app, text=">>", command=pengisian, align="bottom") #button_pengisian.bg="green" #button_pengisian.text_color="white" button_pengisian.width = 5 button_pengisian.height = 2 window = Window(app, title="Inlet Weighing Golden Rubber Indonesia", bg=(255, 255, 255)) space1 = Text(window, text=" xxx", size=10) space1.text_color = "white" space2 = Text(window, text=" xxx", size=5) 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)
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 temp_led.height = 1 ph_led.height = 1 dox_led.height = 1 temp_led.bg = 'red' ph_led.bg = 'red' dox_led.bg = 'red' temp_led.disable() ph_led.disable() dox_led.disable() divider2 = Text(box, text="", grid=[1, 5]) divider2.width = 10 divider2.font = 'Source code pro'
print("X: ", coordX) print("Y: ", coordY) coordX.sort() coordY.sort() print("liste ordinate:") print("X: ", coordX) print("Y: ", coordY) print(type(coordX)) print(type(coordY)) plt.plot(coordX, coordY) plt.ylabel('some numbers') plt.show() app = App(title='interfaccia') hello_text = Text(app, text='interfaccia', font='Arial', size=40) whatever = TextBox(app, width=30, multiline=True, height=2) whatever.value = 'interfaccia/grafico' push = PushButton(app, text='grafico', command=bottone0) push.width = 8 push.height = 3 app.display()
#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 button4 = PushButton(app, Keypad_4, text="4", grid=[1, 5, 1, 1])
welcome_message = Text(startwdw, text=" Coffee Roaster 2.0 ", grid=[0, 2], align="left", size=40, font="Helvetica", color="sienna4") space = Text(startwdw, text="", grid=[0, 3], size=10, align="bottom") startbt = PushButton(startwdw, text="START", command=start_program, grid=[0, 4], image="giantbean.gif") startbt.bg = "black" startbt.height = 170 startbt.width = 225 space = Text(startwdw, text="Click Bean to START", grid=[0, 5], size=26) window1 = Window(app, title="Coffee Roaster", width=480, height=320, layout="grid", bg="white") window1.hide() window1.tk.attributes("-fullscreen", True) #window1.show(wait=True) #welcome window space = Text(window1, text="", grid=[0, 0], size=3) Text1 = Text(window1, text=" Select Roast", grid=[0, 2],
global sante sante = "" calcul.value = sante app = App(title="Calculator", layout="grid") calcul = Text(app, text=str(sante), grid=[0, 0, 4, 1]) button1 = PushButton(app, command=Button1, text="1", grid=[0, 2]) button2 = PushButton(app, command=Button2, text="2", grid=[1, 2]) button3 = PushButton(app, command=Button3, text="3", grid=[2, 2]) button4 = PushButton(app, command=Button4, text="4", grid=[0, 3]) button5 = PushButton(app, command=Button5, text="5", grid=[1, 3]) button6 = PushButton(app, command=Button6, text="6", grid=[2, 3]) button7 = PushButton(app, command=Button7, text="7", grid=[0, 4]) button8 = PushButton(app, command=Button8, text="8", grid=[1, 4]) button9 = PushButton(app, command=Button9, text="9", grid=[2, 4]) button0 = PushButton(app, command=Button0, text="0", grid=[0, 5, 3, 1]) button0.width = 10 buttonPlus = PushButton(app, command=ButtonPlus, text="+", grid=[3, 2]) buttonMinus = PushButton(app, command=ButtonMinus, text="-", grid=[3, 3]) buttonDivide = PushButton(app, command=ButtonDivide, text="/", grid=[3, 4]) buttonMultiply = PushButton(app, command=ButtonMultiply, text="x", grid=[3, 5]) buttonsqrt = PushButton(app, command=ButtonSQRT, text="√x", grid=[4, 3]) button22 = PushButton(app, command=ButtonSquare, text="x^2", grid=[4, 4]) button22.width = 1 buttonEqual = PushButton(app, command=ButtonEqual, text="=", grid=[4, 5]) buttonClean = PushButton(app, command=Buttonclean, text="C", grid=[4, 2]) app.display