Professional Documents
Culture Documents
10 Slide
10 Slide
SimpleGUI
Event to false
Process?
Yes Process
No
Request to
Terminate?
Yes ProcessButtonEvent
Terminate
Menu A menu pane, used to implement pull down and popup menus.
"Times 10 bold"
"Helvetica 10 bold italic"
"Courier New 20 bold italic"
"Courier New 20 bold italic over strike underline"
© Copyright 2018 by Pearson Education, Inc. All Rights Reserved.
7
Text Formatting
The text in a label and a button is centered by default. You
can change it by using the justify option with values LEFT,
CENTER, or RIGHT. You can also display the text in
multiple lines by inserting the newline character \n to
separate texts.
WidgetsDemo
x
Y Axis
(0, 0) X Axis
y
(x, y)
(0, 0) X Axis
Python Coordinate Conventional
System Coordinate
System
Y Axis
CanvasDemo
canvas.create_rectangle(x1, y1, canvas.create_oval(x1, y1, x2, y2) canvas.create_arc(x1, y1, x2, y2, start, extent)
x2, y2)
(x2, y2)
(x1, y1) ABCDE
(x1, y1)
(x2, y2)
(x3, y3) (x, y)
canvas.create_line(x1, y1, x2, y2) canvas.create_oval(x1, y1, x2, y2, x3, y3) canvas.create_text(x, y, text = "ABCDE")
GridManagerDemo
PackManagerDemo1
PackManagerDemo2
PlaceManagerDemo
LoanCalculator
SudokuGUI
© Copyright 2018 by Pearson Education, Inc. All Rights Reserved.
20
Display Images
You can add an image in a label, button, check
button, and radio button. To create an image, use
the PhotoImage class as follows:
ImageDemo
DeckOfCardsGUI
© Copyright 2018 by Pearson Education, Inc. All Rights Reserved.
23