faqts : Computers : Programming : Languages : Python : Tkinter

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 4 people (50%) answered Yes
Recently 2 of 4 people (50%) answered Yes

Entry

Is it possible to have multiple rectangle canvases on screen?

Jan 29th, 2005 06:10
Eric Wood, Keith Jones,


Easily.
You have to give them different names (duh)
You can have as many as you want.
Here's the code:

#import Tkinter and set up root window
from Tkinter import *
root = Tk()
app = Frame(root)
app.grid()

#create canvases
c1 = Canvas(app)
c1.grid()

c2 = Canvas(app)
c2.grid()

root.mainloop()