开发者

Python Tkinter: Draw arrows within Label

I want to draw arrows (that change size dynamically) within a Label or any other widget. I have these arranged as a grid. How can I do this? Would I need a Canvas? (not used yet ... curren开发者_StackOverflowtly just a grid of labels).

I am using Python & Tkinter Gui library.


It will not be compatible on older systems, but you could use unicode: "▲", "▼", "◀" and "▶".

To change the size, you can just change the font size or do something like:

-▶
--▶
---▶


The easiest and probably only way to draw arrows in a label widget would be to use some font that provides label glyphes.

Otherwise you either need the canvas or some other widget that allows you to draw aribitrary shapes (e.g. tkzinc http://wiki.python.org/moin/TkZinc ).


Tkinter does not support drawing on top of widgets. Your only choice for drawing arrows is to use a canvas. Your only other option is to draw directly on a image that is used by a label or button, but there's no support for that other than to set the value of individual pixels.

Your only practical choice is to use a canvas.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜