[英]Tkinter ~ Is Drawing a Canvas to GUI possible using .grid()?
Is it possible to draw lines such as the following with the Tkinter .grid()
system?是否可以使用 Tkinter
.grid()
系统绘制如下线? Every tutorial that talks about canvas
drawing uses .pack()
exclusively.每个讨论
canvas
绘图的教程都专门使用.pack()
。
There are no answers for using canvas
with .grid()
when you search online.在线搜索时,没有使用
canvas
和.grid()
的答案。
I have tried using canvas with .grid()
but my GUI got completely messed up and no lines were drawn.我曾尝试将 canvas 与
.grid()
一起使用,但我的 GUI 完全搞砸了,没有画线。
Is it actually possible to use canvas with .grid()
?实际上可以将 canvas 与
.grid()
一起使用吗?
You use neither grid
nor pack
for drawing items on a canvas.您既不使用
grid
也不使用pack
在 canvas 上绘制项目。 The canvas has the following methods for drawing: canvas的绘图方法如下:
If you're not actually asking about drawing figures on canvas, but on adding the canvas to a window with pack
or grid
, you can use either.如果您实际上不是在询问在 canvas 上绘制图形,而是在将 canvas 添加到带有
pack
或grid
的 window 时,您可以使用其中任何一个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.