Python - Tkinter画布-Canvas: Canvas是一个长方形的面积,图画或其他复杂的布局。可以放置在画布上的图形,文字,部件,或是帧
Canvas是一个长方形的面积,图画或其他复杂的布局。可以放置在画布上的图形,文字,部件,或是帧.
语法:
这里是一个简单的语法来创建这个widget:
w = Canvas ( master, option=value, ... )
参数:
-
master: 这代表了父窗口.
-
options: 下面是这个小工具最常用的选项列表。这些选项可以作为键 - 值对以逗号分隔.
Option | Description |
---|---|
bd | Border width in pixels. Default is 2. |
bg | Normal background color. |
confine | If true (the default), the canvas cannot be scrolled outside of the scrollregion. |
cursor | Cursor used in the canvas like arrow, circle, dot etc. |
height | Size of the canvas in the Y dimension. |
highlightcolor | Color shown in the focus highlight. |