Пример #1
0
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
Пример #2
0
        "scattered clouds": "black",
        "broken clouds": "black",
        "rain": "white",
        "shower rain": "white",
        "thunderstorm": "white",
        "snow": "white",
        "mist": "black"
    }
    return switcher.get(description, "black")


weather_font_color = which_color(description)
Image_picture = which_image(description)
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,
Пример #3
0
def test_image():
    a = App()
    d = Drawing(a)
    id = d.image(1, 2, "../examples/guizero.gif")
    assert id > 0
    a.destroy()
Пример #4
0
           300,
           400,
           250,
           450,
           color="yellow",
           outline=5,
           outline_color="green")
d.triangle(310,
           400,
           360,
           400,
           310,
           450,
           color=None,
           outline=5,
           outline_color="green")

d.image(10, 500, "guizero.png", width=350, height=100)

d.text(10, 600, "guizero")
d.text(110, 600, "guizero", font="times new roman")
d.text(210, 600, "guizero", size=24)
d.text(10,
       650,
       "this is a some text which goes over the width and is wrapped",
       font="arial",
       size=16,
       max_width=350)

a.display()