def test_getters_setters(): a = App() a.title = "bar" assert a.title == "bar" a.bg = "red" assert a.bg == "red" a.height = 666 assert a.height == 666 a.width = 666 assert a.width == 666 a.destroy()
] buttons = button_widget.spin_up_main_buttons(app, main_buttons_commands) spacer_widget.spin_up_top_bottom_spacers(app) spacer_widget.hide_top_bottom_spacers() confirm_widget.spin_up_confirm_widget(app) item_info_box = Box(app, width='fill', layout='grid') barcodes_commands = [ scan_in_key_pressed, scan_out_key_pressed, look_up_key_pressed ] barcodes = barcode_widget.get_barcodes(item_info_box, barcodes_commands) label_widget.spin_up_item_labels(item_info_box) editable_text_widget.spin_up_editable_texts(item_info_box, spin_up_key_pad) editable_text_widget.hide_text_boxes() button_widget.spin_up_edit_button(item_info_box, try_save_new_item) button_widget.hide_edit_button() picture_widget.spin_up_picture(app) key_pad_widget.spin_up_key_pad_box(app) reset_display() app.bg = '#011627' app.set_full_screen() app.repeat(5000, motion_widget.check_for_motion) app.tk.config(cursor='none') app.display()
from guizero import App, Text app = App(title='Hello World') message = Text(app, text='Welcome to the my Hello World ! app') app.bg = "white" app.display()
# import libraries from guizero import App, PushButton, Slider, Text, Window from gpiozero import OutputDevice, PWMOutputDevice, AngularServo from gpiozero.pins.pigpio import PiGPIOFactory #Define the app and window for the servo sliders app = App("Dual Robot Control", layout='grid') servo_window = Window(app, "Servo Movement and PWM") servo_window.bg = (51, 165, 255) app.bg = (51, 246, 255) #Define the factories factory = PiGPIOFactory(host='') factory2 = PiGPIOFactory(host='') # Define both robots en_1 = PWMOutputDevice(12, pin_factory=factory) en_2 = PWMOutputDevice(26, pin_factory=factory) motor_in1 = OutputDevice(13, pin_factory=factory) motor_in2 = OutputDevice(21, pin_factory=factory) motor_in3 = OutputDevice(17, pin_factory=factory) motor_in4 = OutputDevice(27, pin_factory=factory) pin1 = OutputDevice(7, pin_factory=factory2) pin2 = OutputDevice(8, pin_factory=factory2) pin3 = OutputDevice(9, pin_factory=factory2) pin4 = OutputDevice(10, pin_factory=factory2) # Define the servos servo = AngularServo(22, min_angle=-90, max_angle=90, pin_factory=factory) servo_two = AngularServo(23, min_angle=-90, max_angle=90, pin_factory=factory)
from guizero import App, Text # create an app called 'app' and give it a name. app = App(title='This is my first GUI') # make app's background pink. app.bg = 'pink' # add a text message to the app named 'app'. firstmessage = Text(app, text='guis are cool!') secondmessage = Text(app, text='this is green') thirdmessage = Text(app, text='I\'m a new message!') # change the font size of message one firstmessage.text_size = 40 # change the background colour of message two secondmessage.bg = 'green' # change text colour, font and text size on message three. thirdmessage.text_color = 'purple' thirdmessage.font = 'Comic Sans MS' thirdmessage.text_size = 30 # display the app. Without this, the app won't show up. app.display()
button3.enable() button4.enable() button5.enable() button6.enable() button7.enable() button8.enable() button9.enable() button0.enable() def close_app(): app.destroy() # App app = App("Hyannis Marina", width=1140, height=700) app.bg = (115, 160, 230) #app.tk.attributes("-fullscreen",True) # Widgets menubar = MenuBar(app, toplevel=["File", "Edit"], options=[ [ ["Today's Report", todays_report], [today.strftime("%Y Report"), yearly_report],\ ["Recent Reports", white_card_folder]], [ ["Today's List", open_window]] ]) title = Text(app, "Yard Crew", color="White", size=30, font="Quicksand Medium") tech = Combo(app, options=techCombo + ["Tech"], selected="Tech" , command=writeTech) tech.text_size = 30 tech.bg = "white"
pass def shutdown(): #check_call(['sudo', 'poweroff']) close_down = app.yesno("SHUTDOWN", "Are you sure?") if close_down == True: app.warn("Ready", "Shutting down") sleep(3) check_call(['sudo', 'poweroff']) else: app.info("Shutdown", "Shutdown aborted") app = App(title='Night Vision', width="780", height="400") app.bg = "black" app.text_color = "green" #app.tk.attributes("-fullscreen", True) ### Code for buttons and functions ### P_10 = PushButton(app, text="10s", width="fill", height="fill", align="right", command=short_preview) #30 seconds P_20 = PushButton(app, text="30s", width="fill", height="fill", align="right",
from guizero import App, Text, Picture def exitGUI(): if app.yesno("Close", "Do you want to quit?"): app.destroy() print("Adios") app = App(title="Hello world") app.bg = "#0000ff" wanted_text = Text(app, "Hello World") wanted_text.text_size = 50 app.display()
else: adaptive = 1 eqState = 1 controlState = 1 testButton.text = 'Stop test' def updateError(): global micSum errorText.value = 'Error = {:.4f}'.format(micSum) # GUI control_app = App(title="Control App", layout='grid') control_app.tk.attributes('-fullscreen', fullScreen) # FULLSCREEN control_app.bg = 'black' control_app.font = 'Inter UI Bold' control_app.text_size = 10 control_app.height = 480 control_app.width = 800 control_app.tk.config(cursor='none') control_app.repeat(1000, thermalCountUp) # Feedback Window FeedbackWindow = Window(control_app) FeedbackWindow.text_size = 18 FeedbackWindow.font = 'Nexa Bold' FeedbackWindow.tk.attributes('-fullscreen', fullScreen) FeedbackWindow.height = 480 FeedbackWindow.width = 800 FeedbackWindow.hide()
global gpsp global gpsd GPSspeed = round((gpsd.fix.speed*2.237),2) if math.isnan(GPSspeed) or GPSspeed < 1: GPSspeed = 0 GPSspeedTargetP = GPSspeed GPSGaugeCluster.delete(GPSspeedNeedle) GPSGaugeCluster.delete(GPSspeedMainReading) GPSspeedNeedle = GPSGaugeCluster.line(GPSspeedxc, GPSspeedyc,GPSspeedxc + (math.cos((((GPSspeedTargetP - GPSspeedMin) * ((3.141592 * 1.25) - 0)) / (GPSspeedMax - GPSspeedMin))-(3.141592 / .75)) * GPSradius), GPSspeedyc + (math.sin((((GPSspeedTargetP - GPSspeedMin) * ((3.141592 * 1.25) - 0)) / (GPSspeedMax - GPSspeedMin))-(3.141592 / .75)) * GPSradius), color="black", width=5) GPSspeedMainReading = GPSGaugeCluster.text(GPSspeedxc , GPSspeedyc+35, text = GPSspeedTargetP,size=20) #****************************************** #----------------OBC MENU---------------- #****************************************** OBC = App(title="OBC", layout="grid") OBC.bg = "#5E0000" spacer = Text(OBC, text = " ", font="digital-7", height="1", size=9, color="orange", grid=[0,0]) spacer = Text(OBC, text="", grid=[0,1]) OBCMainText = Text(OBC, text = "Loading", font="digital-7", height="2", size=50, color="orange", grid=[0,2]) OBCMainText.repeat(250, OBC_Data) spacer = Text(OBC, text="", grid=[0,3]) spacer = Text(OBC, text="", grid=[0,4]) spacer = Text(OBC, text="", grid=[0,5]) spacer = Text(OBC, text="", grid=[0,6]) OBChdat = PushButton(OBC, command=hdat_Pressed, text="h/dat ", align="left", width="fill", grid=[0,7]) OBChdat.bg = "white" OBCmindat = PushButton(OBC, command=mindat_Pressed, text=" min/dat", align="right", width="fill", grid=[0,7]) OBCmindat.bg = "white" spacer = Text(OBC, text="", grid=[0,8]) spacer = Text(OBC, text="", grid=[0,9]) OBChour = PushButton(OBC, command=Hour_Pressed, text="Hour ", align="left", width="fill", grid=[0,10])
import paho.mqtt.subscribe as mqtt_subscribe ############################################################################### ############################################################################### ############################## Main App ####################################### ############################################################################### ############################################################################### app = \ App( title="TigerV3", height=str(screen_height), width=str(screen_width), layout="grid") app.bg = default_bg_color ############################################################################### ############################################################################### ############################## Button Boxes ################################### ############################################################################### ############################################################################### buttons_box_main = \ Box( app, layout="grid", width="fill", height="fill", grid=[0,0])
# This is the import using GUIZero from guizero import App, Text, Picture # Main app body and title app = App(title="Subscribe!") app.bg = "cyan" # Make the app fullscreen app.height = 5000 app.width = 5000 # Subscribe main text subscribe = Text( app, text="Subscribe to Moonwolf Gaming 7197 and XGamerBoiii on YouTube!") subscribe.text_size = 35 # Specifically subscribe to Moonwolf Gaming 7197 MoonwolfGaming7197Profile = Picture(app, image="moonwolfgaming7197.jpg") MoonwolfGaming7197ProfileID = Text(app, text="Moonwolf Gaming 7197") MoonwolfGaming7197ProfileID.text_size = 15 SubMoonwolfGaming7197 = Text(app, text="bit.ly/3hGrg6n") # The and between the profile pictures betweenthesubscribe = Text(app, text="And") betweenthesubscribe.text_size = 25 # Spefically subscribe to XGamerBoiii XGamerBoiiiProfile = Picture(app, image="XGamerBoiii.jpg") XGamerBoiiiProfileID = Text(app, text="XGamerBoiii") XGamerBoiiiProfileID.text_size = 15 SubXGamerBoiii = Text(app, text="bit.ly/33OCvkK")
elif operation == "maximo": resultado = maximo(listaOperacao) elif operation == "somaacu": resultado = somaacu(listaOperacao) elif operation == "soma": resultado = sum(listaOperacao) elif operation == "multiplicacao": resultado = prod(listaOperacao) else: app.error("Error", "That function is non-existant!") clearlist() drawer(resultado) # Variable setup app.bg = "#424242" version = "v1.0" resultado = 0 # GUI title = Text(app, text="alayomas' math utilities", size=17, color="#7F7F7F", font="Cascadia Code") # Title and subtitle subtitleVersion = Text(app, text=version, size=12, color="#7F7F7F", font="Cascadia Code")
GPIO.output(35, GPIO.LOW) else: air_state = 0 air_button.image = path + 'AirSystem_off.png' GPIO.setup(35, GPIO.OUT) GPIO.output(35, GPIO.HIGH) def screen_brightness(): global slider print(slider.value) bl.set_brightness(str(slider.value)) app = App(title="Keypad example", width=480, height=320, layout="grid") app.bg = 'black' rear_light_button = PushButton(app, command=rear_light_callback, grid=[0, 0], align='left', image=path + 'rear_lights_off.png') front_light_button = PushButton(app, command=front_light_callback, grid=[1, 0], align='left', image=path + 'front_lights_off.png') water_pump_button = PushButton(app, command=water_pump_callback, grid=[2, 0], align='left', image=path + 'water_pump_off.png')
info("GUI Tesla Ordering", "You Have Ordered A New Tesla Model X") def alert_text3(): info_var = " Model 3" info("GUI Tesla Ordering", "You Have Ordered A New Tesla Model 3") def alert_textS(): info_var = " Model S" info("GUI Tesla Ordering", "You Have Ordered A New Tesla Model S") def alert_textY(): info_var = " Model Y" info("GUI Tesla Ordering", "You Have Ordered A New Tesla Model Y") app = App(title="GUI Tesla Ordering", bg="black") startup() app.bg = "lavender" display_text = Text(app, text="Order a Tesla", color="dodger blue", size=20) button3 = PushButton(app, text="Model 3 $35,000", command=alert_text3) buttonX = PushButton(app, text="Model X $79,500", command=alert_textX) buttonY = PushButton(app, text="Model Y ~$35,000", command=alert_textY) buttonS = PushButton(app, text="Model S $74,500", command=alert_textS) cycle = PushButton(app, text="Browse Teslas", command=change_picture) app.display()
def h(): app = App(width=800, height=800, title="my first GUI") app.bg = (156, 153, 153) init_control() # menu bar menubar = MenuBar(app, toplevel=["File", "view"], options=[[["music", music_window], ["Exit", exit_app]], [["full-screen", full_screen], ["normal screen", normal_screen]]]) name_box = Box(app, border=1, width="fill") Text(name_box, font="Times New Roman", text="Hosni RPi-GUI-App", width="fill", color=(0, 0, 128)) # win of music Text(app, font="Times New Roman", text="Music", width="fill", color=(145, 15, 15)) music_box1 = Box(app, border=1, width="fill") music_window_button = PushButton( music_box1, align="left", text="Music", command=music_window ) #, image = "/home/pi/Desktop/music/download.png") music_volume_slider = Slider(music_box1, start=100, end=0, command=music_volume, height="fill", width=20, horizontal=False, align="left") music_box2 = Box(music_box1, align="left", width="fill") music_play_button = PushButton(music_box2, text="Play", command=start_music, width="fill") music_pause_button = PushButton(music_box2, text="Pause", command=pause_music, width="fill") music_continue_button = PushButton(music_box2, text="Continue", command=continue_music, width="fill") music_next_button = PushButton(music_box2, text="next", command=next_music, width="fill") music_previous_button = PushButton(music_box2, text="previous", command=previous_music, width="fill") #box3 = Box(box1,align = "left", width = "fill") #music_volume = Slider(box3,start = 100, end = 0 ,command = volume, height = 200, horizontal = False, align = "left") # led intensity text_ledpwm = Text(app, font="Times New Roman", text="LED intensity", width="fill", color=(145, 15, 15)) box4 = Box(app, border=1, width="fill") LEDPwm = Slider(box4, command=LED_intensity_control, width="fill", align="left") LEDPwm.bg = (255, 255, 255) text2 = Text(box4, text="D of LED = 0 %", align="left") text2.text_color = (0, 0, 128) # Fan speed fan_speed_text = Text(app, font="Times New Roman", text="Fan speed", width="fill", color=(145, 15, 15)) fan_speed_box = Box(app, border=1, width="fill") fan_speed_slider = Slider(fan_speed_box, command=fan_speed_control, width="fill", align="left") fan_speed_slider.bg = (255, 255, 255) fan_speed_display = Text(fan_speed_box, text="D of fan= 0 %", align="left") fan_speed_display.text_color = (0, 0, 128) # Ddisplay on lcd lcd_text = Text(app, font="Times New Roman", text="LCD", color=(145, 15, 15)) lcd_box = Box(app, border=1, width="fill") lcd_text_box = TextBox(lcd_box, width="fill", align="left") disply_lcd = PushButton(lcd_box, text="Display", command=display_on_lcd, align="left") lcd_text_box.bg = (255, 255, 255) lcd_text_box.text_size = 15 # Servo motor servo_text = Text(app, font="Times New Roman", text="Servo angle", width="fill", color=(145, 15, 15)) servo_box1 = Box(app, border=1, width="fill") servo_angle = TextBox(servo_box1, width="fill", align="left") rotate = PushButton(servo_box1, text="Rotate", align="left", command=servo_rotate) servo_box2 = Box(app, border=1, width="fill") rotate_0 = PushButton(servo_box2, text="Rotate 0 ", align="left", width="fill", command=servo_rotate_zero) rotate_90 = PushButton(servo_box2, text="Rotate 90", align="left", width="fill", command=servo_rotate_90) rotate_180 = PushButton(servo_box2, text="Rotate180", align="left", width="fill", command=servo_rotate_180) servo_angle.bg = (255, 255, 255) servo_angle.text_size = 15 # Control room light room_text = Text(app, font="Times New Roman", text="Room Light", width="fill", color=(145, 15, 15)) room_box = Box(app, border=1, width="fill") room_turnon = PushButton(room_box, text="Turn on", width="fill", command=turn_on, align="left") room_turnoff = PushButton(room_box, text="Turn off", width="fill", command=turn_off, align="left") room_state = Text(room_box, align="left") room_state.value = "OFF" room_state.text_color = (102, 0, 51) Text(app) # Box which group the four boxes sensors_box = Box(app, width="fill") # display ultrasonic reading ultrasonic_box = Box(sensors_box, border=1, width="fill", align="left") ultrasonic_text = Text(ultrasonic_box, font="Times New Roman", text="Ultrasonic Reading", width="fill", color=(145, 15, 15)) ultrasonic_reading_text = Text(ultrasonic_box, text="the Distance = 0 CM") ultrasonic_reading_text.repeat(200, ultrasonic_measure) # PIR object Detection PIR_box = Box(sensors_box, border=1, width="fill", align="left") PIR_text = Text(PIR_box, font="Times New Roman", text="Object Detection", width="fill", color=(145, 15, 15)) PIR_reading_text = Text(PIR_box) PIR_reading_text.repeat(150, PIR_detect) # Sound sensor sound_box = Box(sensors_box, border=1, width="fill", align="left") sound_text = Text(sound_box, font="Times New Roman", text="Sound Detection", width="fill", color=(145, 15, 15)) sound_reading_text = Text(sound_box) sound_reading_text.repeat(200, sound_detect) # flame sensor flame_box = Box(sensors_box, border=1, width="fill", align="left") flame_text = Text(flame_box, font="Times New Roman", text="Flame Detection", width="fill", color=(145, 15, 15)) falme_reading_text = Text(flame_box) falme_reading_text.repeat(200, flame_detect) app.display()
#!/usr/bin/env python3 from guizero import App, Text, Picture app = App( "Wanted!" ) app.bg = "#FBFBD0" wanted_text = Text( app, "WANTED!" ) wanted_text.text_size = 50 wanted_text.font = "Impact" cat = Picture( app, image="tabitha.png" ) app.display()
from guizero import App, Text, Picture def exitGUI(): if app.yesno("Close", "Do you want to quit?"): app.destroy() print("Adios") app = App("Wanted!") app.bg = "#A0A0A0" #"#FBFBD0" wanted_text = Text(app, "DROID") wanted_text.text_size = 50 wanted_text.font = "Times New Roman" cat = Picture(app, image="droid.png") app.when_closed = exitGUI app.display()
# # Basic Sample # from guizero import App, Text, Picture from guizero import system_config app = App(title="Hello World") app.bg = (251, 251, 208) message = Text(app, text="Deal with\nconfinement") message.text_size = 50 message.font = "Courier" print(system_config.supported_image_types) maze = Picture(app, image='./confinement.jpg') (width, height) = (maze.width // 6, maze.height // 6) maze = maze.resize(width=width, height=height) app.display()
# Imports from guizero import App, Text, PushButton from random import choice # Functions def choose_name(): # print("Button was pressed") first_name = ["Barbara", "Woody", "Tiberius", "Smokey", "Jennifer", "Ruby"] last_name = [ "Spindleshanks", "Mysterioso", "Dungeon", "Catseye", "Darkmeyer", "Flamingobreath" ] spy_name = choice(first_name) + " " + choice(last_name) # print(spy_name) name.value = spy_name # App app = App("Top Secret") app.bg = (231, 166, 153) # widgets title = Text(app, text="Push the red button to find out your spy name") button = PushButton(app, choose_name, text="Tell me!!") button.bg = (229, 55, 18) button.text_size = 30 name = Text(app, text="") # Display app.display()
# import the libraries from guizero import App, Text, PushButton, Slider, Window from gpiozero import Robot, LED, AngularServo from gpiozero.pins.pigpio import PiGPIOFactory # Define the app robot_movement = App("Linus Movement") servo_window = Window(app, "Servo Control") # Background color robot_movement.bg = (88, 255, 51) # Define the factory # Insert IP address here factory = PiGPIOFactory(host='') # Define the robot linus = Robot(left=(13, 21), right=(17, 27), pin_factory=factory) # Define the LED that will be used for the eye eye = LED(16, pin_factory=factory) #Define the servos servo = AngularServo(22, min_angle=-90, max_angle=90, pin_factory=factory) servo_two = AngularServo(23, min_angle=-90, max_angle=90, pin_factory=factory) # Define the directions and the eye def direction_one(): linus.forward() def direction_two(): linus.backward()
from guizero import App, Text, Picture # Title of app window app = App("Wanted!") app.bg = "#b29a52" # background colour / it cab be named, hex or RGB wanted_Text = Text(app, text="WANTED") wanted_Text.text_size = 50 wanted_Text.font = "Times New Roman" Alex = Picture(app, image="images/Alex_418.png") # app.display() must be present for the window to show app.display()
from guizero import App, Text, Picture, PushButton, Combo, TextBox from random import choice app = App(title="Proof Calculator", width='350', height='600') #Titles the Window of the app message =Text(app, text="How boozy is it?", font="Libre Baskerville", size="18") #The first field (app) tells the lcoation of the text to display app.bg = "#cce6ff" #BACKGROUND color. can take hex or RGD coordiantes martini_pic = Picture(app, image="./Coupe256.png") proof_sum = 0 total_proof = 0 total_volume = 0 display_drink = Text(app, text='', font="Libre Baskerville") recipe = Text(app, text='', font="Libre Baskerville", size = '10') # Dictionary with common spirits and their alcohol % spirits = {" ":0, 'Amaretto':28, "Bourbon":40, "Brandy":40, "Campari":24, "Champagne":12, "Chartreuse, Green":55, "Chartreuse, Yellow":40, "Cider, n/a":0, "Cointreau":40, "Cognac":40, "Genever":43, "Gin":42, "Ginger Beer":0, "Grain":95, "Liqueuer, generic":20, "Luxardo":32, "Mezcal":40, "Juice":0,"Rum":40, "Scotch":45, "Schnapps":18, "Simple syrup":0, "Soda":0, "Tequila":40, "Tonic":0, "Vermouth":18, "Vokda":40, "Water":0, "Whiskey":45, "Wine":15 } ingredients = [" ", "Amaretto", "Bourbon", "Brandy", "Campari", "Champagne", "Chartreuse, Green", "Chartreuse, Yellow", "Cider, n/a", "Cointreau", "Cognac", "Genever", "Gin", "Ginger Beer", "Grain", "Liqueuer, generic", "Luxardo", "Mezcal", "Juice","Rum", "Scotch", "Schnapps", "Simple syrup", "Soda", "Tequila", "Tonic", "Vermouth", "Vokda", "Water", "Whiskey", "Wine"] def refresh_drinks():
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()
camera.framerate = 25 devastator_eye = LED(25) # Define the functions def capture_camera(): devastator_eye.on() moment = datetime.now() camera.start_recording("/home/pi/video_%02d_%02d_%02d.mjpg" % (moment.hour, moment.minute, moment.second)) def stop_record(): devastator_eye.off() camera.stop_recording() # Define the app app = App("PiCamera Recording") app.bg = (45, 232, 225) camera_text = Text(app, text="Camera recording", size=20) # Create the buttons to record and stop recording record = PushButton(app, command=capture_camera, text="Record") record.bg = "green" record.text_size = 20 stop = PushButton(app, command=stop_record, text="Stop") stop.bg = "red" stop.text_size = 20 # Display the app app.display()
# imports ------------------------------- from guizero import App, Text, PushButton # initialise variables ------------------ displayString = '' a = False b = False result = 0 operator = '' operatorFlag = False # app ----------------------------------- app = App(title='MyCalc', layout='grid') app.bg = '#000000' # functions ----------------------------- def inputNumber(key): global displayString, operatorFlag if operatorFlag: displayString='' operatorFlag = False displayString = displayString + key display.value = displayString def operatorKey(key): global a, operator, operatorFlag, displayString operator = key operatorFlag = True if not a: a = float(displayString)
servo_Vertical = AngularServo(27, min_angle=-90, max_angle=90, min_pulse_width=minPWM, max_pulse_width=maxPWM) servo_Vertical.angle = n sleep(2) correction1 = 0.45 correction2 = -0.35 maxPWM = ((2 + correction1) / 1000) minPWM = ((1 + correction2) / 1000) app = App(title="servo control", width=800, height=150) app.bg = "blue" slider_Horizontal = Slider(app, height=40, width=750, start=-90, end=90, command=Turn_Horizontal) slider_Horizontal.bg = "red" slider_Vertical = Slider(app, height=40, width=750, start=-90, end=90, command=Turn_Vertical)
from guizero import App app = App(title="Hello world") app.display() #on run, the program opens a note window with the hello world title from guizero import App, Text, Picture #exit function def exitGUI(): if app.yesno("close", "would you like to close the program?"): app.destroy() print("closing...") app = App("destroy!") app.bg = "#A0B0D0" wanted_text = Text(app, "Damn drones") wanted_text.text_size = 50 wanted_text.font = "Times New Roman" cat = Picture(app, image="drone.jpeg") app.display() #5 from guizero import App, Text, Box, PushButton def do_nothing(): return 0 app = App(title="lab 7 app", height=300, width=300, layout="grid") text = Text(app, text="bla bla bla", grid=[0,0]) box = Box(app, layout="grid", grid=[1,0]) button1 = PushButton(box, command=do_nothing, text="1", grid=[0,0])
app = App(title='interfaccia-grafico') grafico_text = Text(app, text='Grafico', font = 'arial', size=40) whatever = TextBox(app, width=50, multiline=True, height=2) whatever.value='Interfaccia grafico' output = TextBox(app, width=80, height=10, multiline=True) push1 =PushButton(app, text='definire le coordinate', command=tasto0) push2 =PushButton(app, text='coordinate', command=tasto1) push3 = PushButton(app, text='grafico', command=tasto2) app.bg="#000000" grafico_text.text_color ="#FFFFFF" whatever.bg="#FFFFFF" push1.bg="#E52B50" push2.bg="#CC9966" push3.bg="#5E86C1" output.bg="#008f39" app.display()
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") bgroup = ButtonGroup(a, ["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 = "green" 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" bgroup.bg = "yellow" bgroup.text_color = "#e62112" bgroup.font = "book antiqua"