tkintertools.core.virtual¶
字数 768 个 代码 257 行 阅读时间 6 分钟 访问量
Various virtual classes
The virtual Widget
consists of 5 parts, which are Widget
, Shape
, Text
, Image
and Feature
.
Where Feature
is the function of widgets, and each widget can be bound to up to one, but in terms of appearance, there is no limit to the number of Shape
, Text
, and Image
.
Shape
, Text
, and Image
are all appearance components that inherit from abstract base class Components
.
🟢Component
¶
class
public
| ABC
Widget
widget
: parent widgetrelative_position
: position relative to its widgetssize
: size of componentname
: name of componentanimation
: Wether use animation to change colorstyles
: style dict of componentkwargs
: extra parameters for CanvasItem
🟡__getitem__
¶
method
special
🟡__setitem__
¶
method
special
🟡_get_disabled_style
¶
method
protected
🟡appear
¶
method
public
🟡center
¶
method
public
Component
🟡configure
¶
method
public
Component
and update them immediately 🟡coords
¶
method
public
Component
🟡destroy
¶
method
public
Component
🟡detect
¶
method
public
Component
🟡disappear
¶
method
public
🟡display
¶
method
public
Component
on a Canvas
🟡move
¶
method
public
Component
🟡moveto
¶
method
public
Component
to a certain position 🟡region
¶
method
public
Component
🟡update
¶
method
public
Update the style of the Component
to the corresponding state
state
: the state of theComponent
🟡zoom
¶
method
public
Component
🟢Feature
¶
class
public
| ABC
Widget
widget
: parent widget
🟡_click_center
¶
method
protected
🟡_click_left
¶
method
protected
🟡_click_right
¶
method
protected
🟡_copy
¶
method
protected
🟡_cut
¶
method
protected
🟡_input
¶
method
protected
🟡_move_center
¶
method
protected
🟡_move_left
¶
method
protected
🟡_move_none
¶
method
protected
🟡_move_right
¶
method
protected
🟡_paste
¶
method
protected
🟡_release_center
¶
method
protected
🟡_release_left
¶
method
protected
🟡_release_right
¶
method
protected
🟡_select_all
¶
method
protected
🟡_wheel
¶
method
protected
🟢Image
¶
class
public
| Component
Widget
widget
: parent widgetrelative_position
: position relative to its widgetssize
: size of componentimage
: image object of the componentname
: name of componentanimation
: Wether use animation to change colorstyles
: style dict of componentkwargs
: extra parameters for CanvasItem
🟡zoom
¶
method
public
🟢Shape
¶
class
public
| Component
🟡zoom
¶
method
public
🟢Text
¶
class
public
| Component
Widget
widget
: parent widgetrelative_position
: position relative to its widgetssize
: size of componenttext
: text valuefamily
: font familyfontsize
: font sizeweight
: weight of the fontslant
: slant of the fontunderline
: wether text is underlineoverstrike
: wether text is overstrikejustify
: justify of the textanchor
: anchor of the textlimit
: limit on the number of charactersshow
: display a value that obscures the original contentplaceholder
: a placeholder for the promptname
: name of componentanimation
: Wether use animation to change colorstyles
: style dict of componentkwargs
: extra parameters for CanvasItem
🟡region
¶
method
public
Text
🟡zoom
¶
method
public
🟢Widget
¶
class
public
| object
Base Widget Class
Widget
= Shape
+ Text
+ Image
+ Feature
+ Widget
master
: parent canvasposition
: position of the widgetsize
: size of the widgetname
: name of the widgetstate
: default state of the widgetthrough
: wether detect another widget under the widgetanimation
: wether enable animation
🟡appear
¶
method
public
🟡deregister
¶
method
public
🟡destroy
¶
method
public
🟡detect
¶
method
public
Widget
🟡disabled
¶
method
public
🟡disappear
¶
method
public
🟡move
¶
method
public
🟡moveto
¶
method
public
🟡register
¶
method
public
🟡update
¶
method
public
🟡zoom
¶
method
public