Question: Assume that in a program, the following statement creates a Canvas widget and assigns it to the self.canvas variable: self.canvas = tkinter.Canvas(self.main_window, width=200, height=200) Write
Assume that in a program, the following statement creates a Canvas widget and assigns it to the self.canvas variable:
self.canvas = tkinter.Canvas(self.main_window, width=200, height=200)
Write statements that do the following:
a) Draws a blue line from the Canvas widget’s upper-left corner to its lower-right corner. The line should be 3 pixels wide.
b) Draws a rectangle with a red outline and a black interior. The rectangle’s corners should appear in the following locations on the Canvas:
• Upper-left: (50, 50)
• Upper-right: (100, 50)
• Lower-left: (50, 100)
• Lower-right: (100, 100)
c) Draws a green circle. The circle’s center-point should be at (100, 100), and its radius should be 50.
d) Draws a blue-filled arc that is defined by a bounding rectangle with its upper-left corner at (20, 20), and its lower-right corner at (180, 180). The arc should start at 0 degrees, and extend for 90 degrees.
Step by Step Solution
3.50 Rating (163 Votes )
There are 3 Steps involved in it
import tkinter class MyCanvasApp def initself mainwindow selfmainwindow mainwindow selfcanvas tkinte... View full answer
Get step-by-step solutions from verified subject matter experts
