CSCA20H3 Lecture : Tkinter.docx

101 views4 pages
School
Course
Professor

Document Summary

What you show in the label is the text, which is a type of string. -then the way you assign the values to the text may be different !! For all cases, to construct a gui, by using tkinter, the first two steps is always th same: from tkinter import , window=tk() 1 if you want to insert a label, with static text content label=label(window, text="hello laura" ) label. pack() Hence import tkinter: create window # to create the parent widget, create data=stringvar # this is to create a model to store data frame=frame(window) # to create a frame inside a window. -need to introduce the controller , which is a definition of click() Counter. set(counter. get()+1) # counter is the same as data, Def click() import tkinter: create window # to create the parent widget, create a model to store data. Counter. set(0) # different from strivar, you wanna start your calculation from zero!!!

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions