diff --git a/404.html b/404.html index 6d4caf35..66a18a36 100755 --- a/404.html +++ b/404.html @@ -1 +1 @@ - tkintertools

404 - Not found

\ No newline at end of file + tkintertools

404 - Not found

\ No newline at end of file diff --git a/documents/constants/index.html b/documents/constants/index.html index 340a98a1..c5fe9a8f 100755 --- a/documents/constants/index.html +++ b/documents/constants/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}
跳转至

tkintertools.constants#

约 499 个字 59 行代码 预计阅读时间 7 分钟

文件描述: All constants
外部引用: math, platform
源码位置: tkintertoolsconstants.py

Constants - 常量#

BORDERWIDTH Constant

BORDERWIDTH: int = 1
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.constants#

约 499 个字 59 行代码 预计阅读时间 7 分钟

文件描述: All constants
外部引用: math, platform
源码位置: tkintertoolsconstants.py

Constants - 常量#

BORDERWIDTH Constant

BORDERWIDTH: int = 1
 

Default widget borderwidth

CAMERA_DISTANCE Constant

CAMERA_DISTANCE: int = 1000
 

Default 3D camera distance

COLOR_FILL_BUTTON Constant

COLOR_FILL_BUTTON: tuple = ('#E1E1E1', '#E5F1FB', '#CCE4F7', '#E0E0E0')
 

Default Button fill color

COLOR_FILL_CHECKBUTTON Constant

COLOR_FILL_CHECKBUTTON: tuple = ('#E1E1E1', '#E5F1FB', '#CCE4F7', '#E0E0E0')
diff --git a/documents/exceptions/index.html b/documents/exceptions/index.html
index c66d25d8..611fc93d 100755
--- a/documents/exceptions/index.html
+++ b/documents/exceptions/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.exceptions#

约 72 个字 12 行代码 预计阅读时间 1 分钟

文件描述: All exceptions
外部引用:
源码位置: tkintertoolsexceptions.py

Classes - 类#

01. ColorArgsValueError#

ColorArgsValueError(ValueError) Class

颜色函数参数值错误

__init__ Method Special

__init__(
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.exceptions#

约 72 个字 12 行代码 预计阅读时间 1 分钟

文件描述: All exceptions
外部引用:
源码位置: tkintertoolsexceptions.py

Classes - 类#

01. ColorArgsValueError#

ColorArgsValueError(ValueError) Class

颜色函数参数值错误

__init__ Method Special

__init__(
     self,
     value: float
 ) -> None
diff --git a/documents/main/index.html b/documents/main/index.html
index 0b9573dc..5d1bcb2b 100755
--- a/documents/main/index.html
+++ b/documents/main/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.main#

约 2839 个字 513 行代码 预计阅读时间 53 分钟

文件描述: Main File
外部引用: Image, ImageTk, constants, exceptions, fractions, math, tkinter, typing
源码位置: tkintertoolsmain.py

Functions - 函数#

01. _get_control_lst#

_get_control_lst Function Internal

_get_control_lst(
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.main#

约 2839 个字 513 行代码 预计阅读时间 53 分钟

文件描述: Main File
外部引用: Image, ImageTk, constants, exceptions, fractions, math, tkinter, typing
源码位置: tkintertoolsmain.py

Functions - 函数#

01. _get_control_lst#

_get_control_lst Function Internal

_get_control_lst(
     controller,
     length
 )
diff --git a/documents/tools_3d/index.html b/documents/tools_3d/index.html
index 9e667a6e..a3d96411 100755
--- a/documents/tools_3d/index.html
+++ b/documents/tools_3d/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.tools_3d#

约 1635 个字 260 行代码 预计阅读时间 28 分钟

文件描述: 3D support
外部引用: array, constants, exceptions, main, math, statistics, tkinter, typing
源码位置: tkintertoolstools_3d.py

Functions - 函数#

01. project#

project Function

project(
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

tkintertools.tools_3d#

约 1635 个字 260 行代码 预计阅读时间 28 分钟

文件描述: 3D support
外部引用: array, constants, exceptions, main, math, statistics, tkinter, typing
源码位置: tkintertoolstools_3d.py

Functions - 函数#

01. project#

project Function

project(
     coordinate,
     distance
 )
diff --git a/index.html b/index.html
index 30cec2f3..e34401bf 100755
--- a/index.html
+++ b/index.html
@@ -1,4 +1,4 @@
- Profile - 简介 - tkintertools      

约 358 个字 2 行代码 预计阅读时间 3 分钟

tkintertools

logo

tkintertools 是一个基于 tkinterCanvas 类的 UI 框架
tkintertools is a UI framework based on the Canvas class of tkinter

Version License Downloads Total Downloads Size
Watchers Forks Stars Issues Pull Requests Discussions

Insights

Star History Chart

Install - 模块安装#

Stable Release - 稳定版本#

  • Version - 最新版本 : 2.6.21
  • Release - 发布日期 : 2024/01/01
  • Feature - 更新内容 : News-2.6.21
pip install tkintertools
-
Preview - 预览

Preview UI

Preview 3D

Pre Release - 预发布版本#

  • Version - 最新版本 : 3.0.0.beta1
  • Updated - 更新日期 : 2024/05/17
  • Feature - 更新内容 : News-3.0.0
pip install tkintertools==3.0.0b1
-
Preview - 预览
  • Windows11 Light Theme

Light Theme

  • Windows10 Dark Theme

Dark Theme

  • WSL Light Theme

Light Theme

  • macOS Dark Theme

Dark Theme

Warning

tkt 2.* has been discontinued, for new features, please use tkt 3.*. Also note that tkt 3.* is almost completely incompatible with tkt 2.*, and porting a project from tkt 2.* to tkt 3.* can be difficult.
tkt 2.* 已放弃支持,如需获取新的功能,请使用 tkt 3.*。同时请注意,tkt 3.*tkt 2.* 几乎完全不兼容,将项目从 tkt 2.* 移植到 tkt 3.* 可能会十分困难。

More - 更多#

本站统计

  • 总页面:50
  • 总字(词)数:44840
  • 总代码行数:2455
  • 总访问量:

贡献者列表

contributors
\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

约 357 个字 2 行代码 预计阅读时间 3 分钟

tkintertools

logo

tkintertools 是一个基于 tkinterCanvas 类的 UI 框架
tkintertools is a UI framework based on the Canvas class of tkinter

Version License Downloads Total Downloads Size
Watchers Forks Stars Issues Pull Requests Discussions

Insights

Star History Chart

Install - 模块安装#

Stable Release - 稳定版本#

  • 🔖 Version - 最新版本 : 2.6.21
  • 🕓 Release - 发布日期 : 2024/01/01
  • ✨ Feature - 更新内容 : News-2.6.21
pip install tkintertools
+
Preview - 预览

Preview UI

Preview 3D

Development Release - 开发版本#

  • 🔖 Version - 最新版本 : 3.0.0.beta1
  • 🕓 Updated - 更新日期 : 2024/05/17
  • ✨ Feature - 更新内容 : News-3.0.0
pip install tkintertools==3.0.0b1
+
Preview - 预览
  • Windows11 Light Theme

Light Theme

  • Windows10 Dark Theme

Dark Theme

  • WSL Light Theme

Light Theme

  • macOS Dark Theme

Dark Theme

Warning

tkt 2.* has been discontinued, for new features, please use tkt 3.*. Also note that tkt 3.* is almost completely incompatible with tkt 2.*, and porting a project from tkt 2.* to tkt 3.* can be difficult.
tkt 2.* 已放弃支持,如需获取新的功能,请使用 tkt 3.*。同时请注意,tkt 3.*tkt 2.* 几乎完全不兼容,将项目从 tkt 2.* 移植到 tkt 3.* 可能会十分困难。

More - 更多#

本站统计

  • 总页面:49
  • 总字(词)数:44526
  • 总代码行数:2454
  • 总访问量:

贡献者列表

contributors
\ No newline at end of file diff --git a/more/CHANGELOG/index.html b/more/CHANGELOG/index.html index f9f7761a..545c6eaf 100755 --- a/more/CHANGELOG/index.html +++ b/more/CHANGELOG/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Changelog - 更新日志

约 10243 个字 预计阅读时间 68 分钟

Tip

This changelog has the following 7 types of updates, each of which is represented by 7 different colors
此更新日志有以下 7 中类型的更新内容,分别用 7 中不同颜色来表示

  • 🟢 Added - 新增
  • 🔴 Removed - 移除
  • 🟡 Changed - 变更
  • 🔵 Optimized - 优化
  • 🟣 Fixed - 修复
  • 🟠 Deprecated - 弃用
  • 🟤 Refactored - 重构

🔖 3.0.0.beta1#

🕓 Release Date: 2024-05-17

🟢 Added - 新增

  • The docstrings for a portion of the code has been added
    添加了一部分代码的文本字符串

  • Added the animation class MoveItem to move items on the canvas
    增加了动画类 MoveItem 来移动画布上的 Item

  • The animation base class Animation adds the initialization parameter derivation to control whether the parameters of the callback function are derived
    动画基类 Animation 增加了初始化参数 derivation 来控制回调函数的参数是否求导

  • The subpackage color adds the module colormap to speed up the conversion of color names to their corresponding RGB codes
    子包 color 增加了模块 colormap 来加速颜色名称到其对应 RGB 码的转换速度

  • The subpackage color adds the functions contrast, convert, blend and gradient to complete the color processing mechanism
    子包 color 新增函数 contrastconvertblendgradient 来完善颜色处理机制的功能

  • The subpackage style adds the module theme to control the overall theme of the application
    子包 style 新增模块 theme 来控制应用程序整体的主题

  • Added method disabled to the widget class to disable it. If a style with a disabled state is defined in the stylesheet, the defined style is used, otherwise the style in the disabled state is automatically generated based on the current style (color to background color conversion by a factor of 0.618)
    小部件类新增方法 disabled 来使其处于禁用状态。若在样式表中定义了禁用状态的样式,则会使用定义的样式,否则根据当前样式自动生成禁用状态的样式(色彩向背景色转换 0.618 倍)

  • The widget RadioButton has a new initialization parameter default to control its default state
    小部件 RadioButton 新增初始化参数 default 来控制其默认的状态

  • Experimental support for color strings in RGBA format has been added to the Color subpackage
    颜色子包新增对 RGBA 格式的颜色字符串的实验性支持

🟣 Fixed - 修复

  • Fixed an bug where the animation classes MoveWidget and MoveComponent were not moving objects to the correct position when they were called repeatedly
    修复了动画类 MoveWidgetMoveComponent 在被反复调用的情况下无法将对象移动到正确位置的问题

  • Fixed an bug where the animation class ScaleFontSize did not scale the font size correctly
    修复了动画类 ScaleFontSize 无法正确缩放字体大小的问题

  • Fixed and enhanced a bug with the centering function of container widgets such as Toplevel
    修复并增强了容器小部件 Toplevel 等在居中功能上的问题

🔵 Optimized - 优化

  • Optimized the way to get the style file, the widget can set a relative name to reduce the amount of code, and the relative name starts with a decimal point
    优化了样式文件的获取方式,小组件可以设置相对名称来减少代码量,相对名称以小数点开头

  • The theme mechanism is optimized, there is no longer a need to write a tag in the style file, and the mapping relationship between the color parameters of the item and the keywords of the style file can be written in the definition of Shape, so as to reduce the redundant content in the style file and improve the compatibility between the style files
    主题机制优化,样式文件中不再需要写出 tag,可在 Shape 的定义中写明 Item 的颜色参数与样式文件关键字的映射关系,以此缩减样式文件中的冗余内容,提高各样式文件之间的兼容性

  • Optimized the appearance of some widgets
    优化部分小部件外观

  • Improved cross-platform compatibility
    提高了跨平台的兼容性

  • Improved 3D submodule compatibility with the new version of tkintertools
    提高了 3D 子模块对新版 tkintertools 兼容性

  • Change the constants FONT and SIZE to dynamic values, so that font modifications can take effect globally
    将常量 FONTSIZE 改成动态取值,便于字体修改可以全局生效

🟡 Changed - 变更

  • The animation class Gradient no longer converts an empty color string to black when it accepts it, but simply throws an exception
    动画类 Gradient 在接受空颜色字符串时不再将其转化为黑色,而是直接抛出异常

  • The implementation code for the 3D subpackage has been moved from file three/__init__.py to file three/engine.py
    3D 子包的实现代码从文件 three/__init__.py 移动到了文件 three/engine.py

  • The submodule style has been changed to the sub-package style and its contents have been reorganized
    子模块 style 变更为子包 style,其内容进行了重新的整理

🔴 Removed - 移除

  • Remove the useless class from the submodule images of the subpackage standard
    移除子包 standard 的子模块 images 中无用的类

  • Remove the function color from the color subpack (There are other better implementations)
    移除颜色子包中的函数 color(已有其他更好的实现)

🟤 Refactored - 重构

  • Some of the code has been refactored
    重构了部分代码

🔖 3.0.0.alpha7#

🕓 Release Date: 2024-05-05

🟤 Refactored - 重构

  • Introducing a pure Python-based third-party module, darkdetect, to implement theme dynamic following system and multi-OS dark theme support
    引入纯 Python 实现的第三方模块 darkdetect,以实现主题动态跟随系统以及多操作系统暗黑主题的支持

  • Added text class widget
    新增文本类小部件

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Some basic dialogs have been added
    增加了部分基本对话框

🔖 3.0.0.alpha6#

🕓 Release Date: 2024-04-30

🟤 Refactored - 重构

  • The framework has been further upgraded to allow you to build widgets for complex elements
    框架进一步升级,可以构建复杂元素的小部件了

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • The animation sub-module has been added to build high-precision and complex animations
    新增动画子模块,可以构建高精度复杂动画了

  • Color gradient animations are added to widgets, and special animations are added to some widgets, such as switch switches
    小部件增加颜色渐变动画,部分小部件增加特殊动画,如开关切换等

  • Some widgets have been improved
    完善部分小部件

🔖 3.0.0.alpha5#

🕓 Release Date: 2024-04-16

🟤 Refactored - 重构

  • The framework has been upgraded to allow you to build multi-element widgets
    框架升级,可以构建多元素的小部件了

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • The theme binding method has been changed to improve the degree of automation, free hands as much as possible, and reduce the amount of code for users
    主题绑定方式更改,提高自动化程度,尽可能解放双手,减少用户的代码量

  • UI evolution to reduce aliasing and improve clarity
    UI 进化,减小锯齿感,提升清晰度

  • Some standard widgets have been added
    增加部分标准小部件

🔖 3.0.0.alpha4#

🕓 Release Date: 2024-04-05

🟤 Refactored - 重构

  • The 3D submodule of tkintertools 2 was successfully ported to tkintertools 3
    成功将 tkintertools 2 的 3D 子模块移植到 tkintertools 3

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • Added a theme mechanism that allows two sets of themes that can be switched between light and dark
    新增主题机制,允许明暗两套可切换的主题

  • The UI has been updated to provide both Windows 10 and Windows 11 style dark and bright themes
    UI 更新,提供 Windows 10 和 Windows 11 风格的暗黑与明亮两套主题

  • Highly customizable widgets are now available
    可高度定制化小部件了

🔖 3.0.0.alpha3#

🕓 Release Date: 2024-02-20

🟤 Refactored - 重构

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • The designer is in development mode
    设计器已进入开发状态

🔖 3.0.0.alpha2#

🕓 Release Date: 2024-02-18

🟤 Refactored - 重构

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Added some widgets
    新增一些小部件

  • The background color of the container widget automatically follows the parent widget
    容器小部件的背景色自动跟随父小部件

🔖 3.0.0.alpha1#

🕓 Release Date: 2024-02-17

🟤 Refactored - 重构

  • The widget framework has been built, the details are not yet completed, and some widgets have been built for testing
    小部件框架搭建完成,细节部分还未完成,已构建部分小部件用于测试

  • Customizable widgets are now available
    可定制化小部件了

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Improved Canvas’s scaling mechanism
    完善了 Canvas 的缩放机制

  • Added some widgets
    新增一些小部件

🔖 3.0.0.dev9#

🕓 Release Date: 2023-02-16

🟤 Refactored - 重构

  • The widget framework is almost complete, and the details are not yet complete
    小部件框架基本完成,细节部分还未完成

🔖 3.0.0.dev8#

🕓 Release Date: 2023-02-15

🟤 Refactored - 重构

  • Container widget tkintertools.Canvas has completed support for tkinter._CanvasItemId, as well as a host of other improvements
    容器小部件 tkintertools.Canvas 已完成对 tkinter._CanvasItemId 的支持,以及其它大量改进

🔖 3.0.0.dev7#

🕓 Release Date: 2023-02-04

🟤 Refactored - 重构

  • Container widget tkintertools.Canvas has been adapted to three layouts: Pack, Place, and Grid, with Place being strengthened
    容器小部件 tkintertools.Canvas 已完成对三种布局方式 PackPlaceGrid 的适配,其中 Place 被加强

🔖 3.0.0.dev6#

🕓 Release Date: 2024-01-19

🟤 Refactored - 重构

  • The window nesting feature is added under the Windows platform
    Windows 平台下新增窗口嵌套功能

  • Added controls for window border color, title bar background color, and title bar foreground color under the Windows platform
    Windows 平台下新增对窗口边框颜色、标题栏背景色和标题栏前景色的控制

🔖 3.0.0.dev5#

🕓 Release Date: 2023-09-26

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev4#

🕓 Release Date: 2023-09-24

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev3#

🕓 Release Date: 2023-09-21

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev2#

🕓 Release Date: 2023-09-21

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev1#

🕓 Release Date: 2023-09-20

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev0#

🕓 Release Date: 2023-09-19

🟤 Refactored - 重构

  • Start a refactoring of the new version of tkintertools 3 to solve the problems that can’t be solved in tkintertools 2 and bring more and better features!
    开启全新版本 tkintertools 3 的重构,以解决 tkintertools 2 中无法解决的问题,并带来更多更棒的功能!

🔖 2.6.21#

🕓 Release Date: 2024-01-01

🟡 Changed - 变更

  • The class Text in submodule tools_3d was renamed Text3D to distinguish Text in main
    子模块 tools_3d 中的类 Text 更名为 Text3D 以区分 main 中的 Text

🔵 Optimized - 优化

  • Improved Type Hints
    完善了类型提示

🟣 Fixed - 修复

  • Fixed a bug where the parameter proportion of the function color was invalid
    修复了函数 color 的参数 proportion 失效的问题

  • Fixed a bug where the configure parameter of the Switch class was incorrect
    修复了类 Switch 的方法 configure 参数取值错误的问题

🔴 Removed - 移除

  • Animation has removed the color parameter (can be implemented with the callback parameter)
    动画类 Animation 移除了参数 color(可用参数 callback 代替实现)

🔖 2.6.20#

🕓 Release Date: 2023-12-26

🔵 Optimized - 优化

  • The pause and resume functionality of the image class PhotoImage is encapsulated in the methods pause and play
    图片类 PhotoImage 的暂停和继续播放功能被封装为方法 pauseplay

  • Optimized the way the PhotoImage class gets the total number of frames of a gif image, and now you can get the total number of frames by method get_total_frames
    优化类 PhotoImage 获取 gif 图片总帧数的方式,现在可以通过方法 get_total_frames 得到总帧数

  • The color function no longer manually obtains a gradient with a specified regularity, but instead specifies a control function through the parameter controller
    函数 color 不再通过手动方式得到指定规律的渐变色,而是通过参数 controller 指定一个控制函数

🟡 Changed - 变更

  • The original method of play used for PhotoImage to start playback has been renamed to start to avoid conflicts with the method of play to continue playback
    图片类 PhotoImage 原来用于开始播放的方法 play 更名为 start 避免与继续播放的方法 play 起冲突

  • The constant CONTROL was renamed CONTROLLER
    常量 CONTROL 更名为 CONTROLLER

🟣 Fixed - 修复

  • Fixed some incorrect type hints
    修复了一些错误的类型提示

🔖 2.6.19#

🕓 Release Date: 2023-12-17

🟣 Fixed - 修复

  • Fixed a bug where GIFs could not be played
    修复了 gif 动图无法播放的问题

🔵 Optimized - 优化

  • PhotoImage has optimized the mechanism of playing GIFs, and if there is no pre-parsing before playback, it will be automatically parsed during playback
    图片类 PhotoImage 关于播放 gif 动图的机制得到优化,若播放前没有预解析,则会自动进行播放时解析

  • Some codes have been optimized
    优化了部分代码

🔖 2.6.18#

🕓 Release Date: 2023-12-10

🟣 Fixed - 修复

  • Fixed a bug where the actual font size of 3D text with the same font size setting was inconsistent in different locations
    修复在不同位置的但字体大小设定相同的 3D 文本的实际字体大小不一致的 bug

🟡 Changed - 变更

  • Class Canvas_3D was renamed Canvas3D, and Class _3D_Object was renamed to _Object3D
    Canvas_3D 更名为 Canvas3D,类 _3D_Object 更名为 _Object3D

🔵 Optimized - 优化

  • Some codes have been optimized
    优化了部分代码

🔖 2.6.17#

🕓 Release Date: 2023-12-07

🔵 Optimized - 优化

  • Corrected some incorrect English words
    修改了部分错误的英文单词

🟡 Changed - 变更

  • The font unit changes from points to pixels
    字体单位由磅更改为像素

  • Reduced the display position offset of tooltip widgets
    减小了提示框小部件的显示位置偏移

🟣 Fixed - 修复

  • Fixed a bug where tooltip widgets could appear in very wrong places
    修复了提示框小部件有可能显示在非常错误的位置的问题

  • Fixed a bug where the widget class Entry was in a non-centered state and the canvas was shrunk, entering an endless loop when entering text, causing the window to not respond
    修复了小部件类 Entry 在非居中状态,且画布缩小之后,输入文本时进入死循环,导致窗口未响应的问题

  • Fixed a bug where widget color properties were sometimes unchangeable
    修复了小部件颜色属性某些时候不可更改的问题

🔖 2.6.16#

🕓 Release Date: 2023-12-01

🟢 Added - 新增

  • The ToolTip class has added a delay parameter to enhance functionality
    ToolTip 新增参数 delay 来增强功能

🔵 Optimized - 优化

  • The function askfont has been optimized so that the font selection dialog can now be opened without the need for a parent container widget
    对函数 askfont 进行了优化,现在无需父容器小部件也可以打开字体选择对话框

🟡 Changed - 变更

  • The values of some constants have been modified
    部分常量的值进行了修改

🔴 Removed - 移除

  • Removed the function SetProcessDpiAwareness and the constant PROCESS_SYSTEM_DPI_AWARE
    移除函数 SetProcessDpiAwareness 和常量 PROCESS_SYSTEM_DPI_AWARE

🟣 Fixed - 修复

  • Fixed the bug that the font size of the menu bar was abnormal
    修复菜单栏字体大小异常的问题

  • Fixed the bug that images could not be loaded
    修复图片无法加载的问题

🔖 2.6.15#

🕓 Release Date: 2023-11-26

🟢 Added - 新增

  • A new method for the Animation class is called shutdown to terminate the current animation
    Animation 新增方法 shutdown 来终止当前动画

  • The geometry class Cuboid and the geometry class Tetrahedron of submodule tools_3d have been initialized to increase the degree of freedom in style configuration
    子模块 tools_3d 的类 Cuboid 和类 Tetrahedron 新增一些初始化参数来提高样式配置的自由度

  • The constants TCL, PROPORTION, SEQLENGTH, and NUM are added
    新增常量 TCLPROPORTIONSEQLENGTHNUM

  • The color function adds the parameters seqlength and num to enhance the functionality
    函数 color 新增参数 seqlengthnum 来增强功能

🔵 Optimized - 优化

  • The parameter support for the function color has been expanded to support color names such as red, skyblue, and cyan2
    函数 color 的参数支持的范围扩大,可以支持诸如 red、skyblue 和 cyan2 等颜色名称

  • Some functions can be called without the need for a parent widget
    部分函数无需父小部件即可调用

🟣 Fixed - 修复

  • Fixed a bug where the function color would get an incorrect result in rare cases
    修复了函数 color 在罕见情况下会得到错误结果的问题

🔖 2.6.14#

🕓 Release Date: 2023-11-17

🟢 Added - 新增

  • The CheckButton widget class adds a font parameter to modify its font
    小部件类 CheckButton 新增参数 font 来修改其字体

🟡 Changed - 变更

  • Modify the name of some color constants and the parameters related to some colors
    修改部分颜色常量的名称和部分颜色相关的参数

  • The widget class Progressbar is renamed to ProgressBar
    小部件类 Progressbar 更名为 ProgressBar

🟣 Fixed - 修复

  • Fixed the bug that the color of the Switch of the widget class was displayed incorrectly
    修复小部件类 Switch 颜色显示错误的问题

  • Fixed a bug where the initial color of the CheckButton of the widget class would not be displayed immediately
    修复小部件类 CheckButton 初始颜色不会立刻显示的问题

  • Fixed the bug that the text style of the widget class Entry was not updated after calling the method set
    修复小部件类 Entry 在调用方法 set 之后文本样式没有更新的问题

🔖 2.6.13#

🕓 Release Date: 2023-11-17

🟢 Added - 新增

  • The submodule tools_3d adds markup text-related functions and corresponding parameters to the class Point: markuptext, markupdelta, markupfont, markupfill, and markupjustify
    子模块 tools_3d 的类 Point 新增标记文本相关功能以及对应参数:markuptextmarkupdeltamarkupfontmarkupfillmarkupjustify

  • Submodule tools_3d adds a new class Text to implement 3D text that is always facing us (unlike markup text, which has a zoom function)
    子模块 tools_3d 新增类 Text 来实现始终朝向我们的 3D 文本(与标记文本不同,其有缩放功能)

🟡 Changed - 变更

  • The class Switch has been partially refactored from a stand-alone class to a subclass that inherits from the base class BaseWidget, and a number of methods have been added that are compatible with BaseWidget
    Switch 部分重构,由独立类变更为继承基类 BaseWidget 的子类,添加了许多和 BaseWidget 兼容的方法

  • Change the main code file name to main.py to avoid occupying the special file name __main__.py
    修改主代码文件名称为 main.py,避免占用特殊文件名 __main__.py

🟣 Fixed - 修复

  • Fixed a bug where submodule tools_3d was reversed on Z coordinates, i.e., changing the spatial coordinate system from a left-handed coordinate system to a right-handed coordinate system
    修复子模块 tools_3d 在 Z 坐标上正负颠倒的问题,即,将空间坐标系由左手坐标系改为右手坐标系

🔖 2.6.12#

🕓 Release Date: 2023-11-15

🟢 Added - 新增

  • Widget class CheckButton adds parameter tick to change its markup symbol
    小部件类 CheckButton 新增参数 tick 来改变其标记符号

  • The Switch widget class adds parameters color_fill_slider and color_outline_slider to change the appearance of its internal sliders
    小部件类 Switch 新增参数 color_fill_slidercolor_outline_slider 来更改其内部滑块的外观

🔵 Optimized - 优化

  • Drastically changed the format of the docstring to solve the problem that the docstring was displayed out of order on PyCharm
    大幅度修改 docstring 的格式,以解决 docstring 在 PyCharm 上格式显示错乱的问题

  • Remove redundant code
    移除冗余代码

  • Optimized tools_3d submodule code to improve performance by 13.26%
    优化了 tools_3d 子模块代码,提高了 13.26% 的性能

🟣 Fixed - 修复

  • Fixed a bug where when clicking on a widget, the widget behind it would also be triggered
    修复了点击小部件时,其后面的小部件也会被触发的问题

  • Missing symbol ‘#’ for function color return value
    函数 color 返回值缺少符号 “#”

  • Fixed a bug where the canvas of the tools_3d submodule could not use widgets such as buttons
    修复了 tools_3d 子模块的画布无法使用按钮等小部件的问题

  • Fixed a bug where the Switch of the Widget class could not control the Switch by clicking on the inner slider
    修复了小部件类 Switch 点击内部滑块无法操控 Switch 的问题

🔖 2.6.11#

🕓 Release Date: 2023-10-17

🔵 Optimized - 优化

  • Optimized the code of submodule tools_3d, introduced built-in module array instead of the underlying list to improve the calculation speed, and improved the overall performance by 11.66% !
    优化了子模块 tools_3d 的代码,引入内置模块 array 代替底层列表来提高计算速度,综合性能提升 11.66% !

🔴 Removed - 移除

  • Removed classes _Point, _Line and _Side from submodule tools_3d
    移除了子模块 tools_3d 中的类 _Point_Line_Side

🔖 2.6.10#

🕓 Release Date: 2023-08-12

🟢 Added - 新增

  • Added file exceptions.py and exception classes ScaleArgsValueError, ColorArgsValueError and WidgetStateModeError to provide a description of some exceptions
    新增文件 exceptions.py 及异常类 ScaleArgsValueErrorColorArgsValueErrorWidgetStateModeError 以提供部分异常的描述

  • The widget Progressbar adds a indeterminate mode
    小部件 Progressbar 新增不定模式

🟡 Changed - 变更

  • The value of the constant SWITCH_WIDTH is changed from 0 to 60
    常量 SWITCH_WIDTH 的值从 0 更改为 60

  • The parameter width of class Switch was changed from positional argument to keyword argument
    Switch 的参数 width 由位置参数更改为关键字参数

🔵 Optimized - 优化

  • Change the way the output is formatted in all code from the “%” mode to the more efficient f-string mode
    将所有代码中格式化输出的方式由 “%” 方式更改为效率更高的 f-string 方式

  • Optimized type hints for some code
    优化了部分代码的类型提示

🔴 Removed - 移除

  • Remove the function text and use f-string instead
    移除函数 text,可使用 f-string 来对其进行代替

🔖 2.6.9#

🕓 Release Date: 2023-08-09

🟢 Added - 新增

  • Added new widget switch (Switch)
    新增小部件开关(Switch

  • Added widget Tip (ToolTip) and all virtual widgets added the parameter tooltip
    新增小部件提示框(ToolTip),且所有虚拟小部件新增参数 tooltip

  • Added constants DURATIONTOOLTIP_FGTOOLTIP_BGTOOLTIP_HIGHLIGHT_THICKNESSTOOLTIP_HIGHLIGHT_BACKGROUNDCOLOR_SWITCH_ONCOLOR_SWITCH_OFFSWITCH_WIDTHSWITCH_HEIGHTSWITCH_RADIUS and SWITCH_ANIMATION_MS
    新增常量 DURATIONTOOLTIP_FGTOOLTIP_BGTOOLTIP_HIGHLIGHT_THICKNESSTOOLTIP_HIGHLIGHT_BACKGROUNDCOLOR_SWITCH_ONCOLOR_SWITCH_OFFSWITCH_WIDTHSWITCH_HEIGHTSWITCH_RADIUSSWITCH_ANIMATION_MS

🟣 Fixed - 修复

  • Fixed an issue where the text class widget called method clear was invalid
    修复了文本类小部件调用方法 clear 无效的问题

  • Fixed an issue where the class Animation automatically determined the parent widget of the widget to be moved
    修复了类 Animation 自动确定待移动小部件的父小部件时出现错误的问题

🟡 Changed - 变更

  • The positional parameter length of class CheckButton was renamed height
    CheckButton 的位置参数 length 更名为 height

🔵 Optimized - 优化

  • Optimized the method wm_geometry of class Tk to accommodate some specially formatted parameters
    优化了类 Tk 的方法 wm_geometry 以适应某些特殊格式的参数

🔴 Removed - 移除

  • Removed class Singleton and function move
    移除了类 Singleton 和函数 move

🔖 2.6.8#

🕓 Release Date: 2023-08-03

🟢 Added - 新增

  • If the user’s Python includes a PIL library, PIL is automatically invoked when autoscaling images to extend the functionality of the class PhotoImage
    若使用者的 Python 包含有 PIL 库,则在自动缩放图片时自动调用 PIL 来扩展类 PhotoImage 的功能

  • Added class Animation to achieve more efficient, convenient and functional animation effects
    新增类 Animation 来实现更加高效、更加方便和功能性更强的动画效果

  • Added constant CONTROL
    新增常量 CONTROL

🟣 Fixed - 修复

  • Fixed the bug that widgets Entry and Text would report an error when pasting text
    修复小部件 EntryText 粘贴文本时会报错的 bug
    💡 This bug was discovered by 一梦千年

🟡 Changed - 变更

  • Modified the name of the constant FRAMES to FPS
    修改常量 FRAMES 的名称为 FPS

  • The parameter precision of the method zoom of class PhotoImage was changed from positional argument to keyword argument
    PhotoImage 的方法 zoom 的参数 precision 由位置参数变更为关键字参数

🟠 Deprecated - 弃用

  • The function move is about to be deprecated, please replace it with the new class Animation
    函数 move 即将被弃用,请用新类 Animation 来代替

  • The class Singleton is about to be deprecated and singleton mode classes will no longer be available in subsequent releases
    Singleton 即将被弃用,后续版本中将不再提供单例模式类

🔖 2.6.7#

🕓 Release Date: 2023-07-06

🟢 Added - 新增

  • The function rotate of the 3D submodule adds the keyword axis to provide the function of rotating around the axis
    3D 子模块的函数 rotate 新增关键字参数 axis 来提供绕轴旋转的功能

  • Added constants ROTATE_CENTER, ORIGIN_COORDINATE, ORIGIN_SIZE, ORIGIN_WIDTH, ORIGIN_FILL and ORIGIN_OUTLINE
    新增常量 ROTATE_CENTERORIGIN_COORDINATEORIGIN_SIZEORIGIN_WIDTHORIGIN_FILLORIGIN_OUTLINE

  • Class Tk and Toplevel Added keyword arguments alpha, toolwindow, topmost and transparentcolor
    TkToplevel 新增关键字参数 alphatoolwindowtopmosttransparentcolor

🟣 Fixed - 修复

  • Fixed a bug where the class Text would report an error when scrolling with the mouse wheel
    修复了类 Text 在使用鼠标滚轮滚动时会报错的 bug

🔵 Optimized - 优化

  • Optimized some code and type hints
    优化了部分代码和类型提示

  • Optimized the internal implementation of the functions translate and scale to improve performance
    优化函数 translaterotatescale 内部的实现,提高了性能

  • A large number of incomplete docstrings have been modified and improved
    修改和完善了大量的不完整的文档注释

🟡 Changed - 变更

  • Change some methods of some classes to protection methods
    将部分类的部分方法更改为保护方法

🔴 Removed - 移除

  • Removed abstract classes and abstract methods
    移除了抽象类和抽象方法

🔖 2.6.6#

🕓 Release Date: 2023-07-01

🟢 Added - 新增

  • The classes _Point, _Line, _Side, and Geometry of the 3D submodule all have a new method center that returns the geometric center of the 3D object
    3D 子模块的类 _Point_Line_SideGeometry 都新增一个方法 center 返回该 3D 对象的几何中心

  • Added abstract class _3D_Object as the metabase class for classes _Point, _Line, and _Side
    新增抽象类 _3D_Object 来作为类 _Point_Line_Side 的元基类

🔵 Optimized - 优化

  • Optimized parameter passing in 3D submodules, users do not need to ensure the transitivity of list at all times, and parameters that used to only use the list type are now Iterable type
    优化了 3D 子模块中的参数传递,使用者不需要时刻保证 list 的传递性,且原来只能使用 list 类型的参数现在为 Iterable 类型

  • The way 3D objects are centered in the 3D submodule has changed, which has improved performance and reduced the amount of code
    3D 子模块中 3D 对象居中方式改变,相比原来性能提升了不少,代码量也减少了

  • Corrected some incorrect type hints and improved some missing method comments
    改正了部分错误的类型提示,完善了部分缺少的方法注释

  • In the 3D submodule, the distance between two points was originally calculated with the function hypot, and now the function dist is used directly to calculate the Euclidean distance between two points to improve performance
    3D 子模块中原来用函数 hypot 计算两点间距离,现在直接用函数 dist 计算两点间欧几里得距离,提高性能

  • The position display of widgets of class Point has been optimized in the 3D submodule so that it is always at the forefront
    3D 子模块中优化了类 Point 的小部件位置显示,让其始终保持在最前

  • The calculation formula for the camera distance in the 3D submodule has been optimized to improve the performance by a bit
    3D 子模块中相机距离的计算公式优化,提高了一点性能

🟡 Changed - 变更

  • The parameters point1 and point2 of class Point of the 3D submodule and its parent class _Point were renamed to point_start and point_end respectively
    3D 子模块的类 Point 及其父类 _Point 的参数 point1point2 分别被重命名为 point_startpoint_end

  • The parameter origin_color of the class Space of the 3D submodule has been changed to four new parameters, namely origin_size, origin_width, origin_fill and origin_outline
    3D 子模块的类 Space 的参数 origin_color 被更改为四个新的参数,分别是 origin_sizeorigin_widthorigin_fillorigin_outline

🔴 Removed - 移除

  • The classes Canvas_3D and Space of the 3D submodule remove the parameters dx and dy, and the default field of view of the canvas remains centered, i.e. their center is now the original upper-left vertex
    3D 子模块的类 Canvas_3DSpace 移除参数 dxdy,画布默认视野保持居中,也就是说,现在它们的中心位置才是原来的左上角顶点

🔖 2.6.5#

🕓 Release Date: 2023-06-17

🟢 Added - 新增

  • The new class Space added to the submodule tools_3d can provide the ability to translate, rotate and scale 3D objects
    子模块 tools_3d 新增类 Space 可以提供对 3D 对象进行平移、旋转和缩放等操作的功能

🟣 Fixed - 修复

  • Fixed a bug where class Cuboid and class Tetrahedron did not add instances to parent class Canvas_3D
    修复了类 Cuboid 和类 Tetrahedron 没有将实例添加到父类 Canvas_3D 的 bug

  • Fixed a bug where an error was displayed when a 3D object appeared behind the camera position
    修复了当 3D 对象出现在相机位置后面时会显示错误的 bug

  • Fixed some incorrect type hints
    修复了部分错误的类型提示

🔴 Removed - 移除

  • Removed the constant BACKGROUND and no longer qualified the default background color of class Canvas
    移除常量 BACKGROUND 并且不再对类 Canvas 的默认背景颜色做限定

🔖 2.6.4#

🕓 Release Date: 2023-06-12

🟢 Added - 新增

  • The class tool_3d submodule Canvas_3D has added the function space_sort to calculate and sort the actual position of space to support the correct display of geometry colors
    tool_3d 子模块的类 Canvas_3D 新增对空间实际位置进行计算和排序的函数 space_sort,以支持几何体颜色的正确显示

🟣 Fixed - 修复

  • Fixed a bug where movement and rotation between points, lines, and sides in the 3D module are out of sync
    修复了 3D 模块中的点、线与面之间移动和旋转不同步的 bug

  • Fixed a bug where class Canvas_3D in the 3D module would be invalid when passing arguments to class Canvas in the original tkinter module
    修复了 3D 模块中的类 Canvas_3D 在传递原 tkinter 模块中的类 Canvas 的参数时会无效的 bug

🟡 Changed - 变更

  • The parameter cfg_3d of class Canvas_3D is changed to 3 specific parameters, namely camera distance camera_distance, picture abscissa deviation dx and screen ordinate deviation dy
    Canvas_3D 的参数 cfg_3d 被更改为 3 个具体的参数,分别为相机距离 camera_distance、画面横坐标偏差 dx 和画面纵坐标偏差 dy

  • In the 3D submodule, the value of the camera distance constant is changed to 1000
    3D 子模块中相机距离常量的值更改为 1000

  • Compatibility changes, because Python 3.7 is about to enter the end-of-life stage, and in order to improve program performance, Python3.7 is not compatible, but Python3.8 is compatible
    兼容性更改,由于 Python3.7 即将步入 end-of-life 阶段,且为了提高程序性能,现无法兼容 Python3.7,但能够兼容 Python3.8

🔖 2.6.3#

🕓 Release Date: 2023-06-07

🔵 Optimized - 优化

  • The 3D object implementation varies with the size of the canvas
    3D 对象实现随画布大小变化而变化

  • Make the default value of the corner radius more intelligent, 4 when the system is Windows11, Linux, Mac, and 0 for the rest
    使圆角半径的默认值更加智能,当系统为 Windows11LinuxMac 时为 4,其余情况为 0

  • Added more type hints, especially for overloads
    添加了更多类型提示,尤其是对重载的提示

🟣 Fixed - 修复

  • Fixed a bug where the parameter keep would affect the position of class Canvas
    修复参数 keep 会对类 Canvas 的位置产生影响的 bug

🟡 Changed - 变更

  • Set the default value of the parameter keep of the class Canvas_3D in the 3D module to True, i.e. keep the canvas width and height scaled proportionally by default
    将3d模块中的类 Canvas_3D 的参数 keep 的默认值设为 True,即默认保持画布宽高缩放成比例

🔖 2.6.2#

🕓 Release Date: 2023-05-30

🟢 Added - 新增

  • Added tkintertools sub-module tools_3d to support drawing 3D graphics
    新增 tkintertools 子模块 tools_3d 以支持绘制 3D 图形

🔖 2.6.1#

🕓 Release Date: 2023-05-21

🔵 Optimized - 优化

  • Enhance the cross platform functionality of the module, which can run on the Windows and Linux platform
    提升模块的跨平台性,可在 Windows 和 Linux 平台上运行

  • Optimized reference documentation for classes and functions
    优化了类和函数的参考文档

  • Improved module compatibility to Python 3.7
    提升模块兼容性,向下兼容至 Python3.7

  • Optimized test files, compatible with different operating systems, and fixed a small number of bugs
    优化了测试文件,兼容不同操作系统,修复少量 bug

  • Optimize the methods of the widget checkbox CheckButton
    优化小部件复选框 CheckButton 的各项功能

  • The class Canvas adds parameters x and y to reduce redundant code
    Canvas 新增参数 xy 以减少多余代码

🟣 Fixed - 修复

  • Fixed a bug where widgets would misalign after calling the method moveto
    修复了小部件在调用了方法 moveto 后会发生错位的 bug

🔴 Removed - 移除

  • Remove Unused Constants SCALE
    删除无用常量 SCALE

🔖 2.6.0#

🕓 Release Date: 2023-03-28

🟢 Added - 新增

  • New virtual canvas widget check box: CheckButton
    新增虚拟画布小部件复选框:CheckButton

🟣 Fixed - 修复

  • Solve the bug that the Text class set and append methods will not be updated immediately after use
    解决 Textsetappend 方法使用后不会立即更新的 bug

🔵 Optimized - 优化

  • Optimize the parameters of some classes and functions
    优化部分类和函数的参数

🔖 2.5.12#

🕓 Release Date: 2023-03-20

🟢 Added - 新增

  • Add a image parameter to all widgets to add a background image
    所有小部件新增参数 image 来添加背景图片

🟣 Fixed - 修复

  • Fixed a bug where the move function cannot move a window
    修复了 move 函数无法移动窗口的 bug

🔵 Optimized - 优化

  • Move the binding code of the associated keyboard from class Tk to class Canvas
    将关联键盘的绑定代码全部由类 Tk 移到类 Canvas

  • Optimized some of the code to prevent bugs that shouldn’t occur
    优化了部分代码,防止出现一些不应该出现的 bug

🔴 Removed - 移除

  • Deleted function font
    删除了函数 font

🔖 2.5.11#

🕓 Release Date: 2023-03-13

🟢 Added - 新增

  • Class Canvas adds parameter keep to extend function
    Canvas 新增参数 keep 以扩展功能

  • Add the tool function SetProcessDpiAwareness to enhance the function
    新增工具函数 SetProcessDpiAwareness 以增强功能

  • New tool function font is added to solve the problem of font size matching DPI level
    新增工具函数 font 以解决字体大小适配 DPI 级别的问题

🟣 Fixed - 修复

  • Fixed the problem of inaccurate Python version requirements. The minimum module operation requirement should be Python 3.11
    修复了 Python 版本要求不准确的问题,模块最低运行要求应为 Python3.11

  • Fixed the problem that the configure method of _BaseWidget cannot get the normal effect when modifying the parameter text to an empty string
    修复了小部件基类 _BaseWidget 的方法 configure 在将参数 text 修改为空字符串时无法得到正常效果的问题

🔵 Optimized - 优化

  • Optimize the solution to the adaptive DPI problem
    优化解决适配 DPI 问题的方案

  • Optimized the way font size fits DPI
    优化了字体大小适配 DPI 的方式

  • The canvas widget will be scaled according to the scale of the canvas when it is placed, rather than after it is placed
    画布小部件在放置时就会根据画布的缩放而缩放,而不是在放置后才进行缩放

🔖 2.5.10#

🕓 Release Date: 2023-02-04

🟢 Added - 新增

  • Canvas virtual widget base class _BaseWidget Add instance attribute command_ex to extend functions
    画布虚拟小部件基类 _BaseWidget 新增实例属性 command_ex 以扩展功能

  • Function move adds parameter end to enhance function
    函数 move 新增参数 end 以增强功能

  • New method of canvas virtual widget base class moveto
    画布虚拟小部件基类新增方法 moveto

🟣 Fixed - 修复

  • Fixed the bug that the class Tk cannot make the distance between the window and the screen 0
    修复了类 Tk 无法使窗口与屏幕距离为 0 的 bug

  • Fixed the bug that the parameter borderwidth of the widget is invalid when it has rounded corners
    修复了小部件在有圆角状态下参数 borderwidth 失效的 bug

🟡 Changed - 变更

  • The initialization parameters of Tk class and Toplevel class have become more concise
    Tk 类和 Toplevel 类的初始化参数变得更加简洁了

🔵 Optimized - 优化

  • The state change of the canvas virtual widget adds a previous state detection, greatly improving performance
    画布虚拟小部件的状态改变加了个先前状态检测,大幅提高性能

  • The performance of function move has been optimized
    函数 move 的性能得到了优化

🔖 2.5.9#

🕓 Release Date: 2023-01-13

🟢 Added - 新增

  • Class PhotoImage new method stop is used to stop the playback of moving pictures
    PhotoImage 新增方法 stop 用于停止动图的播放

🟣 Fixed - 修复

  • Fixed an incomplete parameter bug in the moveto method of the Canvas class
    修复了 Canvas 类的方法 moveto 在参数上不完备的 bug

  • Fixed a bug that sometimes causes multiple widgets to touch at the same time
    修复了有时候会产生多个小部件同时触碰的 bug

  • Fixed parameter error of class PhotoImage
    修复了类 PhotoImage 的参数错误

🔵 Optimized - 优化

  • Optimize codes, simplify some codes and delete redundant parts
    优化代码,简化部分代码,删去冗余部分

🔴 Removed - 移除

  • The redundant parameters minsize and alpha of the Tk and Toplevel classes have been deleted
    删除了 Tk 类和 Toplevel 类的冗余参数 minsizealpha

🔖 2.5.8#

🕓 Release Date: 2023-01-12

🟣 Fixed - 修复

  • Fixed a bug that the function move cannot perform the default move mode flat
    修复了函数 move 无法进行默认的移动模式 flat 的 bug

  • Solve the bug that the cursor will flash faster and faster after pasting text for text widget
    解决文本类小部件在粘贴文本后光标会越闪越快的 bug

🔵 Optimized - 优化

  • move function has been optimized to improve applicability, accuracy and speed
    优化了 move 函数,提升了适用性、精度以及速度

  • Canvas class adds compatibility methods coords, move, moveto and bbox to improve the DPI adaptation problem
    Canvas 类新增兼容方法 coordsmovemovetobbox,完善了 DPI 的适配问题

  • Tk Class Add Method wm_minsize, wm_maxsize to be compatible with DPI adaptation problems
    Tk 类新增方法 wm_minsizewm_maxsize 以兼容 DPI 适配问题

  • Optimize the PhotoImage class so that it can be used without globalization
    优化 PhotoImage 类,使之无需全局化,即可使用

  • Overall optimization of code and reduction of code volume
    总体优化了代码,减少了代码量

🔖 2.5.7#

🕓 Release Date: 2023-01-10

🟢 Added - 新增

  • The move function adds the parameter frames, which can change the number of frames of the animation when moving
    move 函数新增参数 frames,可改变移动时的动画的帧数

  • Tk class adds the adaptation function to screen DPI, which can make the window clearer
    Tk 类新增对屏幕 DPI 的适配功能,可使窗口更加清晰

  • New compatible version and compatible version conversion file
    新增兼容版本以及兼容版本转换文件

🟡 Changed - 变更

  • Change the function names of functions move_widget, correct_text and change_color to move, text and color respectively
    分别将函数 move_widgetcorrect_textchange_color 的函数名变更为 movetextcolor

  • Corrected some parameters
    修正了些许参数

  • Increase the default frame rate parameter of the move function to 30
    提高了移动函数的默认帧率参数至 30

🔵 Optimized - 优化

  • Optimized the code structure of the color function and the move function to make it more concise
    优化了 color 函数和 move 函数的代码结构,使其更加简洁

🔖 2.5.6#

🕓 Release Date: 2022-12-12

🟣 Fixed - 修复

  • Fixed the bug that the singleton mode class (Singleton) could not pass parameters during initialization
    修复了单例模式类(Singleton)在初始化时无法传递参数的 bug

  • Fixed the bug that sometimes the font parameters of _CanvasItemId could not be found when scaling fonts in Canvas class
    修复了 Canvas 类在缩放字体时,有时会找不到 _CanvasItemId 的字体参数的 bug

🟡 Changed - 变更

  • The zoom method of the picture is changed from absolute zoom to relative absolute zoom
    图片的缩放方式由绝对缩放变更为相对的绝对缩放方式

🔵 Optimized - 优化

  • Optimized the structure of the PhotoImage class
    优化了 PhotoImage 类的结构

  • All useless codes (TODO marked) are deleted
    删除了所有无用的代码(TODO 标记的)

  • The fractions module is introduced to improve the precision of image scaling and reduce the operation time
    引入了 fractions 模块并提高了图片缩放时的精度且减少了运算时间

🔴 Removed - 移除

  • Canvas class deletes two redundant and overridden instance methods: create_ bitmap and create_ window
    Canvas 类删除了两个冗余的、重写的实例方法:create_bitmapcreate_window

🔖 2.5.5#

🕓 Release Date: 2022-12-11

🟢 Added - 新增

  • Added type prompt Self for the self parameter of instance methods of all classes
    为所有类的实例方法的 self 参数添加了类型提示 Self

🟣 Fixed - 修复

  • Fixed the bug that the width and height will not change in some cases when scaling Canvas classes
    修复了 Canvas 类缩放时,宽高在某些情况下不会改变的 bug

🟡 Changed - 变更

  • Modified the access method of Tk class, Toplevel class and Canvas class protection attributes
    修改了 Tk 类、Toplevel 类、Canvas 类的保护属性的获取方式

  • Greatly modified the canvas scaling mechanism, fully adapted to all situations, and accelerated the scaling speed
    大幅度地修改了画布缩放的机制,完全适应所有情况,并加快了缩放速度

🔵 Optimized - 优化

  • Optimize the structure of all multiple loops and judgment statements, making the code more beautiful
    优化了所有多重循环加判断语句的结构,使代码更为美观

🔖 2.5.4#

🕓 Release Date: 2022-12-08

🟢 Added - 新增

  • A new widget has been added: progress bar(Progressbar)
    增加了一个新的小部件:进度条(Progressbar

🟣 Fixed - 修复

  • Fixed the bug that the screen size would be abnormal when creating Canvas of different sizes
    修复了新建不同大小的 Canvas 时,画面大小会异常的 bug

  • Solved the bug that there is no change when the font size is scaled under certain conditions
    解决了字体大小进行缩放时,在某种条件下缩小没有变化的 bug

  • Solved the bug that function move_widget cannot move tkinter._CanvasItemId
    解决了函数 move_widget 无法移动 tkinter._CanvasItemId 的 bug

🟡 Changed - 变更

  • The binding mechanism of associated events has been modified so that Canvas classes can be created at any time
    修改了关联事件的绑定机制,使得 Canvas 类可以被随时创建

🔵 Optimized - 优化

  • Some colors are beautified
    美化了部分颜色

  • Optimized some codes in function move_widget
    优化了函数 move_widget 中的部分代码

🔖 2.5.3#

🕓 Release Date: 2022-11-27

🟢 Added - 新增

  • Added singleton pattern(Singleton) class for inheritance
    增加了单例模式类(Singleton)供继承

  • Add some methods (attributes) of Tk, Toplevel and Canvas to access some attributes that should not be directly accessed
    增加 TkToplevelCanvas 的一些方法(属性)来访问一些不应该被直接访问的属性

🟣 Fixed - 修复

  • Solved the bug that the destroy method of the widget can only delete half of the widgets when traversing
    解决了小部件的 destroy 方法在遍历使用时只能删除一半小部件的 bug
    💡 This bug was discovered by -ShuiGuang-

🔵 Optimized - 优化

  • Canvas class overrides destroy method to be compatible with the original destroy method
    Canvas 类重写 destroy 方法以兼容原 destroy 方法

  • Toplevel class overrides destroy method to be compatible with the original destroy method
    Toplevel 类重写 destroy 方法以兼容原 destroy 方法

  • Some codes of Tk and Toplevel are optimized, and the code amount of Toplevel widgets is greatly reduced
    优化了 TkToplevel 的部分代码,Toplevel 小部件的代码量大大缩减

🔴 Removed - 移除

  • The proportion_lock parameter and its function of Tk and Toplevel are deleted
    删除了 TkToplevelproportion_lock 参数及其功能

🔖 2.5.2#

🕓 Release Date: 2022-11-25

🟢 Added - 新增

  • Added mouse style for text type virtual widget
    添加了对文本类虚拟小部件的鼠标样式

🟣 Fixed - 修复

  • Solved the bug that the set and append methods of text virtual widgets may fail in some cases
    解决了文本类虚拟小部件 setappend 方法某些时候会失效的 bug

  • Solved the bug that the mouse style flickers when the mouse cursor moves over the button
    解决了鼠标光标移动到按钮上时的鼠标样式会闪烁的 bug

  • Fixed the bug that the read parameter of the text box widget failed
    修复了文本框小部件 read 参数失效的 bug

🔵 Optimized - 优化

  • Change the mouse position detection order to further improve the running speed
    改变鼠标位置检测顺序,进一步提升运行速度

🔖 2.5.1#

🕓 Release Date: 2022-11-23

🟢 Added - 新增

  • Added mouse style for button virtual widgets
    添加了对按钮虚拟小部件的鼠标样式

🟣 Fixed - 修复

  • Solved the bug that the input prompt position was not aligned after the input box was enlarged
    解决了输入框放大后输入提示符位置没对齐的 bug

  • Solved the bug that text virtual widgets will lose focus after being pasted once
    解决了文本类虚拟小部件粘贴一次后会失去焦点的 bug

  • Fix a few errors in the module documentation
    修复模块文档中的少许错误

🟡 Changed - 变更

  • Modified the mouse position determination mechanism and improved the running speed
    修改了鼠标位置判定机制,同时提升运行速度

🔵 Optimized - 优化

  • Some redundant codes are deleted to improve the overall running speed
    删除了部分冗余代码,提升总体运行速度

📑 Older Logs - 旧日志#

Note

The following logs belong to the ones found from ancient commit records, only date and version number, no specific content… Since I didn’t get into the habit of logging before, there are no more detailed logs, but fortunately the version number is inherited 😅
下面的日志属于从远古的提交记录中找到的,只有日期和版本号,没有具体的内容…… 由于我以前没有养成记录日志的习惯,故没有更多的详细的日志了,好在版本号继承了下来 😅

Version Release Date Description
2.5.0 2022-11-21 Upload the package to PyPi 🚀
2.4.15 2022-11-18 Drew and uploaded the first version of the logo
2.4.14 2022-11-14 -
2.4.11 2022-11-13 -
2.4.10 2022-11-10 -
2.4.2 2022-11-05 -
2.4.1 2022-11-03 -
2.4.0 2022-11-02 -
2.3.5 2022-11-01 -
2.3.1 2022-10-25 Added project license (MulanPSL-2)
2.3.0 2022-10-22 -
2.2.4 2022-10-20 -
2.2 2022-10-19 -
1.4 2022-09-21 -
1.3 2022-09-20 -
1.0 2022-09-10 The repository was created and uploaded 🎉
0.2 2022-08-29 Modularize codes gradually
0.1 2022-07-23 Where the dream begins!
\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Changelog - 更新日志

约 10243 个字 预计阅读时间 68 分钟

Tip

This changelog has the following 7 types of updates, each of which is represented by 7 different colors
此更新日志有以下 7 中类型的更新内容,分别用 7 中不同颜色来表示

  • 🟢 Added - 新增
  • 🔴 Removed - 移除
  • 🟡 Changed - 变更
  • 🔵 Optimized - 优化
  • 🟣 Fixed - 修复
  • 🟠 Deprecated - 弃用
  • 🟤 Refactored - 重构

🔖 3.0.0.beta1#

🕓 Release Date: 2024-05-17

🟢 Added - 新增

  • The docstrings for a portion of the code has been added
    添加了一部分代码的文本字符串

  • Added the animation class MoveItem to move items on the canvas
    增加了动画类 MoveItem 来移动画布上的 Item

  • The animation base class Animation adds the initialization parameter derivation to control whether the parameters of the callback function are derived
    动画基类 Animation 增加了初始化参数 derivation 来控制回调函数的参数是否求导

  • The subpackage color adds the module colormap to speed up the conversion of color names to their corresponding RGB codes
    子包 color 增加了模块 colormap 来加速颜色名称到其对应 RGB 码的转换速度

  • The subpackage color adds the functions contrast, convert, blend and gradient to complete the color processing mechanism
    子包 color 新增函数 contrastconvertblendgradient 来完善颜色处理机制的功能

  • The subpackage style adds the module theme to control the overall theme of the application
    子包 style 新增模块 theme 来控制应用程序整体的主题

  • Added method disabled to the widget class to disable it. If a style with a disabled state is defined in the stylesheet, the defined style is used, otherwise the style in the disabled state is automatically generated based on the current style (color to background color conversion by a factor of 0.618)
    小部件类新增方法 disabled 来使其处于禁用状态。若在样式表中定义了禁用状态的样式,则会使用定义的样式,否则根据当前样式自动生成禁用状态的样式(色彩向背景色转换 0.618 倍)

  • The widget RadioButton has a new initialization parameter default to control its default state
    小部件 RadioButton 新增初始化参数 default 来控制其默认的状态

  • Experimental support for color strings in RGBA format has been added to the Color subpackage
    颜色子包新增对 RGBA 格式的颜色字符串的实验性支持

🟣 Fixed - 修复

  • Fixed an bug where the animation classes MoveWidget and MoveComponent were not moving objects to the correct position when they were called repeatedly
    修复了动画类 MoveWidgetMoveComponent 在被反复调用的情况下无法将对象移动到正确位置的问题

  • Fixed an bug where the animation class ScaleFontSize did not scale the font size correctly
    修复了动画类 ScaleFontSize 无法正确缩放字体大小的问题

  • Fixed and enhanced a bug with the centering function of container widgets such as Toplevel
    修复并增强了容器小部件 Toplevel 等在居中功能上的问题

🔵 Optimized - 优化

  • Optimized the way to get the style file, the widget can set a relative name to reduce the amount of code, and the relative name starts with a decimal point
    优化了样式文件的获取方式,小组件可以设置相对名称来减少代码量,相对名称以小数点开头

  • The theme mechanism is optimized, there is no longer a need to write a tag in the style file, and the mapping relationship between the color parameters of the item and the keywords of the style file can be written in the definition of Shape, so as to reduce the redundant content in the style file and improve the compatibility between the style files
    主题机制优化,样式文件中不再需要写出 tag,可在 Shape 的定义中写明 Item 的颜色参数与样式文件关键字的映射关系,以此缩减样式文件中的冗余内容,提高各样式文件之间的兼容性

  • Optimized the appearance of some widgets
    优化部分小部件外观

  • Improved cross-platform compatibility
    提高了跨平台的兼容性

  • Improved 3D submodule compatibility with the new version of tkintertools
    提高了 3D 子模块对新版 tkintertools 兼容性

  • Change the constants FONT and SIZE to dynamic values, so that font modifications can take effect globally
    将常量 FONTSIZE 改成动态取值,便于字体修改可以全局生效

🟡 Changed - 变更

  • The animation class Gradient no longer converts an empty color string to black when it accepts it, but simply throws an exception
    动画类 Gradient 在接受空颜色字符串时不再将其转化为黑色,而是直接抛出异常

  • The implementation code for the 3D subpackage has been moved from file three/__init__.py to file three/engine.py
    3D 子包的实现代码从文件 three/__init__.py 移动到了文件 three/engine.py

  • The submodule style has been changed to the sub-package style and its contents have been reorganized
    子模块 style 变更为子包 style,其内容进行了重新的整理

🔴 Removed - 移除

  • Remove the useless class from the submodule images of the subpackage standard
    移除子包 standard 的子模块 images 中无用的类

  • Remove the function color from the color subpack (There are other better implementations)
    移除颜色子包中的函数 color(已有其他更好的实现)

🟤 Refactored - 重构

  • Some of the code has been refactored
    重构了部分代码

🔖 3.0.0.alpha7#

🕓 Release Date: 2024-05-05

🟤 Refactored - 重构

  • Introducing a pure Python-based third-party module, darkdetect, to implement theme dynamic following system and multi-OS dark theme support
    引入纯 Python 实现的第三方模块 darkdetect,以实现主题动态跟随系统以及多操作系统暗黑主题的支持

  • Added text class widget
    新增文本类小部件

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Some basic dialogs have been added
    增加了部分基本对话框

🔖 3.0.0.alpha6#

🕓 Release Date: 2024-04-30

🟤 Refactored - 重构

  • The framework has been further upgraded to allow you to build widgets for complex elements
    框架进一步升级,可以构建复杂元素的小部件了

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • The animation sub-module has been added to build high-precision and complex animations
    新增动画子模块,可以构建高精度复杂动画了

  • Color gradient animations are added to widgets, and special animations are added to some widgets, such as switch switches
    小部件增加颜色渐变动画,部分小部件增加特殊动画,如开关切换等

  • Some widgets have been improved
    完善部分小部件

🔖 3.0.0.alpha5#

🕓 Release Date: 2024-04-16

🟤 Refactored - 重构

  • The framework has been upgraded to allow you to build multi-element widgets
    框架升级,可以构建多元素的小部件了

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • The theme binding method has been changed to improve the degree of automation, free hands as much as possible, and reduce the amount of code for users
    主题绑定方式更改,提高自动化程度,尽可能解放双手,减少用户的代码量

  • UI evolution to reduce aliasing and improve clarity
    UI 进化,减小锯齿感,提升清晰度

  • Some standard widgets have been added
    增加部分标准小部件

🔖 3.0.0.alpha4#

🕓 Release Date: 2024-04-05

🟤 Refactored - 重构

  • The 3D submodule of tkintertools 2 was successfully ported to tkintertools 3
    成功将 tkintertools 2 的 3D 子模块移植到 tkintertools 3

  • A lot of bugs have been fixed, and a lot of content has been improved within the framework
    修复大量 bug,框架内完善大量内容

  • Added a theme mechanism that allows two sets of themes that can be switched between light and dark
    新增主题机制,允许明暗两套可切换的主题

  • The UI has been updated to provide both Windows 10 and Windows 11 style dark and bright themes
    UI 更新,提供 Windows 10 和 Windows 11 风格的暗黑与明亮两套主题

  • Highly customizable widgets are now available
    可高度定制化小部件了

🔖 3.0.0.alpha3#

🕓 Release Date: 2024-02-20

🟤 Refactored - 重构

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • The designer is in development mode
    设计器已进入开发状态

🔖 3.0.0.alpha2#

🕓 Release Date: 2024-02-18

🟤 Refactored - 重构

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Added some widgets
    新增一些小部件

  • The background color of the container widget automatically follows the parent widget
    容器小部件的背景色自动跟随父小部件

🔖 3.0.0.alpha1#

🕓 Release Date: 2024-02-17

🟤 Refactored - 重构

  • The widget framework has been built, the details are not yet completed, and some widgets have been built for testing
    小部件框架搭建完成,细节部分还未完成,已构建部分小部件用于测试

  • Customizable widgets are now available
    可定制化小部件了

  • Fixed a few bugs and added a lot of content to the framework
    修复些许 bug,框架内增加大量内容

  • Improved Canvas’s scaling mechanism
    完善了 Canvas 的缩放机制

  • Added some widgets
    新增一些小部件

🔖 3.0.0.dev9#

🕓 Release Date: 2023-02-16

🟤 Refactored - 重构

  • The widget framework is almost complete, and the details are not yet complete
    小部件框架基本完成,细节部分还未完成

🔖 3.0.0.dev8#

🕓 Release Date: 2023-02-15

🟤 Refactored - 重构

  • Container widget tkintertools.Canvas has completed support for tkinter._CanvasItemId, as well as a host of other improvements
    容器小部件 tkintertools.Canvas 已完成对 tkinter._CanvasItemId 的支持,以及其它大量改进

🔖 3.0.0.dev7#

🕓 Release Date: 2023-02-04

🟤 Refactored - 重构

  • Container widget tkintertools.Canvas has been adapted to three layouts: Pack, Place, and Grid, with Place being strengthened
    容器小部件 tkintertools.Canvas 已完成对三种布局方式 PackPlaceGrid 的适配,其中 Place 被加强

🔖 3.0.0.dev6#

🕓 Release Date: 2024-01-19

🟤 Refactored - 重构

  • The window nesting feature is added under the Windows platform
    Windows 平台下新增窗口嵌套功能

  • Added controls for window border color, title bar background color, and title bar foreground color under the Windows platform
    Windows 平台下新增对窗口边框颜色、标题栏背景色和标题栏前景色的控制

🔖 3.0.0.dev5#

🕓 Release Date: 2023-09-26

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev4#

🕓 Release Date: 2023-09-24

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev3#

🕓 Release Date: 2023-09-21

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev2#

🕓 Release Date: 2023-09-21

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev1#

🕓 Release Date: 2023-09-20

🟤 Refactored - 重构

  • Basic functions are being refactored…
    基本功能重构中……

🔖 3.0.0.dev0#

🕓 Release Date: 2023-09-19

🟤 Refactored - 重构

  • Start a refactoring of the new version of tkintertools 3 to solve the problems that can’t be solved in tkintertools 2 and bring more and better features!
    开启全新版本 tkintertools 3 的重构,以解决 tkintertools 2 中无法解决的问题,并带来更多更棒的功能!

🔖 2.6.21#

🕓 Release Date: 2024-01-01

🟡 Changed - 变更

  • The class Text in submodule tools_3d was renamed Text3D to distinguish Text in main
    子模块 tools_3d 中的类 Text 更名为 Text3D 以区分 main 中的 Text

🔵 Optimized - 优化

  • Improved Type Hints
    完善了类型提示

🟣 Fixed - 修复

  • Fixed a bug where the parameter proportion of the function color was invalid
    修复了函数 color 的参数 proportion 失效的问题

  • Fixed a bug where the configure parameter of the Switch class was incorrect
    修复了类 Switch 的方法 configure 参数取值错误的问题

🔴 Removed - 移除

  • Animation has removed the color parameter (can be implemented with the callback parameter)
    动画类 Animation 移除了参数 color(可用参数 callback 代替实现)

🔖 2.6.20#

🕓 Release Date: 2023-12-26

🔵 Optimized - 优化

  • The pause and resume functionality of the image class PhotoImage is encapsulated in the methods pause and play
    图片类 PhotoImage 的暂停和继续播放功能被封装为方法 pauseplay

  • Optimized the way the PhotoImage class gets the total number of frames of a gif image, and now you can get the total number of frames by method get_total_frames
    优化类 PhotoImage 获取 gif 图片总帧数的方式,现在可以通过方法 get_total_frames 得到总帧数

  • The color function no longer manually obtains a gradient with a specified regularity, but instead specifies a control function through the parameter controller
    函数 color 不再通过手动方式得到指定规律的渐变色,而是通过参数 controller 指定一个控制函数

🟡 Changed - 变更

  • The original method of play used for PhotoImage to start playback has been renamed to start to avoid conflicts with the method of play to continue playback
    图片类 PhotoImage 原来用于开始播放的方法 play 更名为 start 避免与继续播放的方法 play 起冲突

  • The constant CONTROL was renamed CONTROLLER
    常量 CONTROL 更名为 CONTROLLER

🟣 Fixed - 修复

  • Fixed some incorrect type hints
    修复了一些错误的类型提示

🔖 2.6.19#

🕓 Release Date: 2023-12-17

🟣 Fixed - 修复

  • Fixed a bug where GIFs could not be played
    修复了 gif 动图无法播放的问题

🔵 Optimized - 优化

  • PhotoImage has optimized the mechanism of playing GIFs, and if there is no pre-parsing before playback, it will be automatically parsed during playback
    图片类 PhotoImage 关于播放 gif 动图的机制得到优化,若播放前没有预解析,则会自动进行播放时解析

  • Some codes have been optimized
    优化了部分代码

🔖 2.6.18#

🕓 Release Date: 2023-12-10

🟣 Fixed - 修复

  • Fixed a bug where the actual font size of 3D text with the same font size setting was inconsistent in different locations
    修复在不同位置的但字体大小设定相同的 3D 文本的实际字体大小不一致的 bug

🟡 Changed - 变更

  • Class Canvas_3D was renamed Canvas3D, and Class _3D_Object was renamed to _Object3D
    Canvas_3D 更名为 Canvas3D,类 _3D_Object 更名为 _Object3D

🔵 Optimized - 优化

  • Some codes have been optimized
    优化了部分代码

🔖 2.6.17#

🕓 Release Date: 2023-12-07

🔵 Optimized - 优化

  • Corrected some incorrect English words
    修改了部分错误的英文单词

🟡 Changed - 变更

  • The font unit changes from points to pixels
    字体单位由磅更改为像素

  • Reduced the display position offset of tooltip widgets
    减小了提示框小部件的显示位置偏移

🟣 Fixed - 修复

  • Fixed a bug where tooltip widgets could appear in very wrong places
    修复了提示框小部件有可能显示在非常错误的位置的问题

  • Fixed a bug where the widget class Entry was in a non-centered state and the canvas was shrunk, entering an endless loop when entering text, causing the window to not respond
    修复了小部件类 Entry 在非居中状态,且画布缩小之后,输入文本时进入死循环,导致窗口未响应的问题

  • Fixed a bug where widget color properties were sometimes unchangeable
    修复了小部件颜色属性某些时候不可更改的问题

🔖 2.6.16#

🕓 Release Date: 2023-12-01

🟢 Added - 新增

  • The ToolTip class has added a delay parameter to enhance functionality
    ToolTip 新增参数 delay 来增强功能

🔵 Optimized - 优化

  • The function askfont has been optimized so that the font selection dialog can now be opened without the need for a parent container widget
    对函数 askfont 进行了优化,现在无需父容器小部件也可以打开字体选择对话框

🟡 Changed - 变更

  • The values of some constants have been modified
    部分常量的值进行了修改

🔴 Removed - 移除

  • Removed the function SetProcessDpiAwareness and the constant PROCESS_SYSTEM_DPI_AWARE
    移除函数 SetProcessDpiAwareness 和常量 PROCESS_SYSTEM_DPI_AWARE

🟣 Fixed - 修复

  • Fixed the bug that the font size of the menu bar was abnormal
    修复菜单栏字体大小异常的问题

  • Fixed the bug that images could not be loaded
    修复图片无法加载的问题

🔖 2.6.15#

🕓 Release Date: 2023-11-26

🟢 Added - 新增

  • A new method for the Animation class is called shutdown to terminate the current animation
    Animation 新增方法 shutdown 来终止当前动画

  • The geometry class Cuboid and the geometry class Tetrahedron of submodule tools_3d have been initialized to increase the degree of freedom in style configuration
    子模块 tools_3d 的类 Cuboid 和类 Tetrahedron 新增一些初始化参数来提高样式配置的自由度

  • The constants TCL, PROPORTION, SEQLENGTH, and NUM are added
    新增常量 TCLPROPORTIONSEQLENGTHNUM

  • The color function adds the parameters seqlength and num to enhance the functionality
    函数 color 新增参数 seqlengthnum 来增强功能

🔵 Optimized - 优化

  • The parameter support for the function color has been expanded to support color names such as red, skyblue, and cyan2
    函数 color 的参数支持的范围扩大,可以支持诸如 red、skyblue 和 cyan2 等颜色名称

  • Some functions can be called without the need for a parent widget
    部分函数无需父小部件即可调用

🟣 Fixed - 修复

  • Fixed a bug where the function color would get an incorrect result in rare cases
    修复了函数 color 在罕见情况下会得到错误结果的问题

🔖 2.6.14#

🕓 Release Date: 2023-11-17

🟢 Added - 新增

  • The CheckButton widget class adds a font parameter to modify its font
    小部件类 CheckButton 新增参数 font 来修改其字体

🟡 Changed - 变更

  • Modify the name of some color constants and the parameters related to some colors
    修改部分颜色常量的名称和部分颜色相关的参数

  • The widget class Progressbar is renamed to ProgressBar
    小部件类 Progressbar 更名为 ProgressBar

🟣 Fixed - 修复

  • Fixed the bug that the color of the Switch of the widget class was displayed incorrectly
    修复小部件类 Switch 颜色显示错误的问题

  • Fixed a bug where the initial color of the CheckButton of the widget class would not be displayed immediately
    修复小部件类 CheckButton 初始颜色不会立刻显示的问题

  • Fixed the bug that the text style of the widget class Entry was not updated after calling the method set
    修复小部件类 Entry 在调用方法 set 之后文本样式没有更新的问题

🔖 2.6.13#

🕓 Release Date: 2023-11-17

🟢 Added - 新增

  • The submodule tools_3d adds markup text-related functions and corresponding parameters to the class Point: markuptext, markupdelta, markupfont, markupfill, and markupjustify
    子模块 tools_3d 的类 Point 新增标记文本相关功能以及对应参数:markuptextmarkupdeltamarkupfontmarkupfillmarkupjustify

  • Submodule tools_3d adds a new class Text to implement 3D text that is always facing us (unlike markup text, which has a zoom function)
    子模块 tools_3d 新增类 Text 来实现始终朝向我们的 3D 文本(与标记文本不同,其有缩放功能)

🟡 Changed - 变更

  • The class Switch has been partially refactored from a stand-alone class to a subclass that inherits from the base class BaseWidget, and a number of methods have been added that are compatible with BaseWidget
    Switch 部分重构,由独立类变更为继承基类 BaseWidget 的子类,添加了许多和 BaseWidget 兼容的方法

  • Change the main code file name to main.py to avoid occupying the special file name __main__.py
    修改主代码文件名称为 main.py,避免占用特殊文件名 __main__.py

🟣 Fixed - 修复

  • Fixed a bug where submodule tools_3d was reversed on Z coordinates, i.e., changing the spatial coordinate system from a left-handed coordinate system to a right-handed coordinate system
    修复子模块 tools_3d 在 Z 坐标上正负颠倒的问题,即,将空间坐标系由左手坐标系改为右手坐标系

🔖 2.6.12#

🕓 Release Date: 2023-11-15

🟢 Added - 新增

  • Widget class CheckButton adds parameter tick to change its markup symbol
    小部件类 CheckButton 新增参数 tick 来改变其标记符号

  • The Switch widget class adds parameters color_fill_slider and color_outline_slider to change the appearance of its internal sliders
    小部件类 Switch 新增参数 color_fill_slidercolor_outline_slider 来更改其内部滑块的外观

🔵 Optimized - 优化

  • Drastically changed the format of the docstring to solve the problem that the docstring was displayed out of order on PyCharm
    大幅度修改 docstring 的格式,以解决 docstring 在 PyCharm 上格式显示错乱的问题

  • Remove redundant code
    移除冗余代码

  • Optimized tools_3d submodule code to improve performance by 13.26%
    优化了 tools_3d 子模块代码,提高了 13.26% 的性能

🟣 Fixed - 修复

  • Fixed a bug where when clicking on a widget, the widget behind it would also be triggered
    修复了点击小部件时,其后面的小部件也会被触发的问题

  • Missing symbol ‘#’ for function color return value
    函数 color 返回值缺少符号 “#”

  • Fixed a bug where the canvas of the tools_3d submodule could not use widgets such as buttons
    修复了 tools_3d 子模块的画布无法使用按钮等小部件的问题

  • Fixed a bug where the Switch of the Widget class could not control the Switch by clicking on the inner slider
    修复了小部件类 Switch 点击内部滑块无法操控 Switch 的问题

🔖 2.6.11#

🕓 Release Date: 2023-10-17

🔵 Optimized - 优化

  • Optimized the code of submodule tools_3d, introduced built-in module array instead of the underlying list to improve the calculation speed, and improved the overall performance by 11.66% !
    优化了子模块 tools_3d 的代码,引入内置模块 array 代替底层列表来提高计算速度,综合性能提升 11.66% !

🔴 Removed - 移除

  • Removed classes _Point, _Line and _Side from submodule tools_3d
    移除了子模块 tools_3d 中的类 _Point_Line_Side

🔖 2.6.10#

🕓 Release Date: 2023-08-12

🟢 Added - 新增

  • Added file exceptions.py and exception classes ScaleArgsValueError, ColorArgsValueError and WidgetStateModeError to provide a description of some exceptions
    新增文件 exceptions.py 及异常类 ScaleArgsValueErrorColorArgsValueErrorWidgetStateModeError 以提供部分异常的描述

  • The widget Progressbar adds a indeterminate mode
    小部件 Progressbar 新增不定模式

🟡 Changed - 变更

  • The value of the constant SWITCH_WIDTH is changed from 0 to 60
    常量 SWITCH_WIDTH 的值从 0 更改为 60

  • The parameter width of class Switch was changed from positional argument to keyword argument
    Switch 的参数 width 由位置参数更改为关键字参数

🔵 Optimized - 优化

  • Change the way the output is formatted in all code from the “%” mode to the more efficient f-string mode
    将所有代码中格式化输出的方式由 “%” 方式更改为效率更高的 f-string 方式

  • Optimized type hints for some code
    优化了部分代码的类型提示

🔴 Removed - 移除

  • Remove the function text and use f-string instead
    移除函数 text,可使用 f-string 来对其进行代替

🔖 2.6.9#

🕓 Release Date: 2023-08-09

🟢 Added - 新增

  • Added new widget switch (Switch)
    新增小部件开关(Switch

  • Added widget Tip (ToolTip) and all virtual widgets added the parameter tooltip
    新增小部件提示框(ToolTip),且所有虚拟小部件新增参数 tooltip

  • Added constants DURATIONTOOLTIP_FGTOOLTIP_BGTOOLTIP_HIGHLIGHT_THICKNESSTOOLTIP_HIGHLIGHT_BACKGROUNDCOLOR_SWITCH_ONCOLOR_SWITCH_OFFSWITCH_WIDTHSWITCH_HEIGHTSWITCH_RADIUS and SWITCH_ANIMATION_MS
    新增常量 DURATIONTOOLTIP_FGTOOLTIP_BGTOOLTIP_HIGHLIGHT_THICKNESSTOOLTIP_HIGHLIGHT_BACKGROUNDCOLOR_SWITCH_ONCOLOR_SWITCH_OFFSWITCH_WIDTHSWITCH_HEIGHTSWITCH_RADIUSSWITCH_ANIMATION_MS

🟣 Fixed - 修复

  • Fixed an issue where the text class widget called method clear was invalid
    修复了文本类小部件调用方法 clear 无效的问题

  • Fixed an issue where the class Animation automatically determined the parent widget of the widget to be moved
    修复了类 Animation 自动确定待移动小部件的父小部件时出现错误的问题

🟡 Changed - 变更

  • The positional parameter length of class CheckButton was renamed height
    CheckButton 的位置参数 length 更名为 height

🔵 Optimized - 优化

  • Optimized the method wm_geometry of class Tk to accommodate some specially formatted parameters
    优化了类 Tk 的方法 wm_geometry 以适应某些特殊格式的参数

🔴 Removed - 移除

  • Removed class Singleton and function move
    移除了类 Singleton 和函数 move

🔖 2.6.8#

🕓 Release Date: 2023-08-03

🟢 Added - 新增

  • If the user’s Python includes a PIL library, PIL is automatically invoked when autoscaling images to extend the functionality of the class PhotoImage
    若使用者的 Python 包含有 PIL 库,则在自动缩放图片时自动调用 PIL 来扩展类 PhotoImage 的功能

  • Added class Animation to achieve more efficient, convenient and functional animation effects
    新增类 Animation 来实现更加高效、更加方便和功能性更强的动画效果

  • Added constant CONTROL
    新增常量 CONTROL

🟣 Fixed - 修复

  • Fixed the bug that widgets Entry and Text would report an error when pasting text
    修复小部件 EntryText 粘贴文本时会报错的 bug
    💡 This bug was discovered by 一梦千年

🟡 Changed - 变更

  • Modified the name of the constant FRAMES to FPS
    修改常量 FRAMES 的名称为 FPS

  • The parameter precision of the method zoom of class PhotoImage was changed from positional argument to keyword argument
    PhotoImage 的方法 zoom 的参数 precision 由位置参数变更为关键字参数

🟠 Deprecated - 弃用

  • The function move is about to be deprecated, please replace it with the new class Animation
    函数 move 即将被弃用,请用新类 Animation 来代替

  • The class Singleton is about to be deprecated and singleton mode classes will no longer be available in subsequent releases
    Singleton 即将被弃用,后续版本中将不再提供单例模式类

🔖 2.6.7#

🕓 Release Date: 2023-07-06

🟢 Added - 新增

  • The function rotate of the 3D submodule adds the keyword axis to provide the function of rotating around the axis
    3D 子模块的函数 rotate 新增关键字参数 axis 来提供绕轴旋转的功能

  • Added constants ROTATE_CENTER, ORIGIN_COORDINATE, ORIGIN_SIZE, ORIGIN_WIDTH, ORIGIN_FILL and ORIGIN_OUTLINE
    新增常量 ROTATE_CENTERORIGIN_COORDINATEORIGIN_SIZEORIGIN_WIDTHORIGIN_FILLORIGIN_OUTLINE

  • Class Tk and Toplevel Added keyword arguments alpha, toolwindow, topmost and transparentcolor
    TkToplevel 新增关键字参数 alphatoolwindowtopmosttransparentcolor

🟣 Fixed - 修复

  • Fixed a bug where the class Text would report an error when scrolling with the mouse wheel
    修复了类 Text 在使用鼠标滚轮滚动时会报错的 bug

🔵 Optimized - 优化

  • Optimized some code and type hints
    优化了部分代码和类型提示

  • Optimized the internal implementation of the functions translate and scale to improve performance
    优化函数 translaterotatescale 内部的实现,提高了性能

  • A large number of incomplete docstrings have been modified and improved
    修改和完善了大量的不完整的文档注释

🟡 Changed - 变更

  • Change some methods of some classes to protection methods
    将部分类的部分方法更改为保护方法

🔴 Removed - 移除

  • Removed abstract classes and abstract methods
    移除了抽象类和抽象方法

🔖 2.6.6#

🕓 Release Date: 2023-07-01

🟢 Added - 新增

  • The classes _Point, _Line, _Side, and Geometry of the 3D submodule all have a new method center that returns the geometric center of the 3D object
    3D 子模块的类 _Point_Line_SideGeometry 都新增一个方法 center 返回该 3D 对象的几何中心

  • Added abstract class _3D_Object as the metabase class for classes _Point, _Line, and _Side
    新增抽象类 _3D_Object 来作为类 _Point_Line_Side 的元基类

🔵 Optimized - 优化

  • Optimized parameter passing in 3D submodules, users do not need to ensure the transitivity of list at all times, and parameters that used to only use the list type are now Iterable type
    优化了 3D 子模块中的参数传递,使用者不需要时刻保证 list 的传递性,且原来只能使用 list 类型的参数现在为 Iterable 类型

  • The way 3D objects are centered in the 3D submodule has changed, which has improved performance and reduced the amount of code
    3D 子模块中 3D 对象居中方式改变,相比原来性能提升了不少,代码量也减少了

  • Corrected some incorrect type hints and improved some missing method comments
    改正了部分错误的类型提示,完善了部分缺少的方法注释

  • In the 3D submodule, the distance between two points was originally calculated with the function hypot, and now the function dist is used directly to calculate the Euclidean distance between two points to improve performance
    3D 子模块中原来用函数 hypot 计算两点间距离,现在直接用函数 dist 计算两点间欧几里得距离,提高性能

  • The position display of widgets of class Point has been optimized in the 3D submodule so that it is always at the forefront
    3D 子模块中优化了类 Point 的小部件位置显示,让其始终保持在最前

  • The calculation formula for the camera distance in the 3D submodule has been optimized to improve the performance by a bit
    3D 子模块中相机距离的计算公式优化,提高了一点性能

🟡 Changed - 变更

  • The parameters point1 and point2 of class Point of the 3D submodule and its parent class _Point were renamed to point_start and point_end respectively
    3D 子模块的类 Point 及其父类 _Point 的参数 point1point2 分别被重命名为 point_startpoint_end

  • The parameter origin_color of the class Space of the 3D submodule has been changed to four new parameters, namely origin_size, origin_width, origin_fill and origin_outline
    3D 子模块的类 Space 的参数 origin_color 被更改为四个新的参数,分别是 origin_sizeorigin_widthorigin_fillorigin_outline

🔴 Removed - 移除

  • The classes Canvas_3D and Space of the 3D submodule remove the parameters dx and dy, and the default field of view of the canvas remains centered, i.e. their center is now the original upper-left vertex
    3D 子模块的类 Canvas_3DSpace 移除参数 dxdy,画布默认视野保持居中,也就是说,现在它们的中心位置才是原来的左上角顶点

🔖 2.6.5#

🕓 Release Date: 2023-06-17

🟢 Added - 新增

  • The new class Space added to the submodule tools_3d can provide the ability to translate, rotate and scale 3D objects
    子模块 tools_3d 新增类 Space 可以提供对 3D 对象进行平移、旋转和缩放等操作的功能

🟣 Fixed - 修复

  • Fixed a bug where class Cuboid and class Tetrahedron did not add instances to parent class Canvas_3D
    修复了类 Cuboid 和类 Tetrahedron 没有将实例添加到父类 Canvas_3D 的 bug

  • Fixed a bug where an error was displayed when a 3D object appeared behind the camera position
    修复了当 3D 对象出现在相机位置后面时会显示错误的 bug

  • Fixed some incorrect type hints
    修复了部分错误的类型提示

🔴 Removed - 移除

  • Removed the constant BACKGROUND and no longer qualified the default background color of class Canvas
    移除常量 BACKGROUND 并且不再对类 Canvas 的默认背景颜色做限定

🔖 2.6.4#

🕓 Release Date: 2023-06-12

🟢 Added - 新增

  • The class tool_3d submodule Canvas_3D has added the function space_sort to calculate and sort the actual position of space to support the correct display of geometry colors
    tool_3d 子模块的类 Canvas_3D 新增对空间实际位置进行计算和排序的函数 space_sort,以支持几何体颜色的正确显示

🟣 Fixed - 修复

  • Fixed a bug where movement and rotation between points, lines, and sides in the 3D module are out of sync
    修复了 3D 模块中的点、线与面之间移动和旋转不同步的 bug

  • Fixed a bug where class Canvas_3D in the 3D module would be invalid when passing arguments to class Canvas in the original tkinter module
    修复了 3D 模块中的类 Canvas_3D 在传递原 tkinter 模块中的类 Canvas 的参数时会无效的 bug

🟡 Changed - 变更

  • The parameter cfg_3d of class Canvas_3D is changed to 3 specific parameters, namely camera distance camera_distance, picture abscissa deviation dx and screen ordinate deviation dy
    Canvas_3D 的参数 cfg_3d 被更改为 3 个具体的参数,分别为相机距离 camera_distance、画面横坐标偏差 dx 和画面纵坐标偏差 dy

  • In the 3D submodule, the value of the camera distance constant is changed to 1000
    3D 子模块中相机距离常量的值更改为 1000

  • Compatibility changes, because Python 3.7 is about to enter the end-of-life stage, and in order to improve program performance, Python3.7 is not compatible, but Python3.8 is compatible
    兼容性更改,由于 Python3.7 即将步入 end-of-life 阶段,且为了提高程序性能,现无法兼容 Python3.7,但能够兼容 Python3.8

🔖 2.6.3#

🕓 Release Date: 2023-06-07

🔵 Optimized - 优化

  • The 3D object implementation varies with the size of the canvas
    3D 对象实现随画布大小变化而变化

  • Make the default value of the corner radius more intelligent, 4 when the system is Windows11, Linux, Mac, and 0 for the rest
    使圆角半径的默认值更加智能,当系统为 Windows11LinuxMac 时为 4,其余情况为 0

  • Added more type hints, especially for overloads
    添加了更多类型提示,尤其是对重载的提示

🟣 Fixed - 修复

  • Fixed a bug where the parameter keep would affect the position of class Canvas
    修复参数 keep 会对类 Canvas 的位置产生影响的 bug

🟡 Changed - 变更

  • Set the default value of the parameter keep of the class Canvas_3D in the 3D module to True, i.e. keep the canvas width and height scaled proportionally by default
    将3d模块中的类 Canvas_3D 的参数 keep 的默认值设为 True,即默认保持画布宽高缩放成比例

🔖 2.6.2#

🕓 Release Date: 2023-05-30

🟢 Added - 新增

  • Added tkintertools sub-module tools_3d to support drawing 3D graphics
    新增 tkintertools 子模块 tools_3d 以支持绘制 3D 图形

🔖 2.6.1#

🕓 Release Date: 2023-05-21

🔵 Optimized - 优化

  • Enhance the cross platform functionality of the module, which can run on the Windows and Linux platform
    提升模块的跨平台性,可在 Windows 和 Linux 平台上运行

  • Optimized reference documentation for classes and functions
    优化了类和函数的参考文档

  • Improved module compatibility to Python 3.7
    提升模块兼容性,向下兼容至 Python3.7

  • Optimized test files, compatible with different operating systems, and fixed a small number of bugs
    优化了测试文件,兼容不同操作系统,修复少量 bug

  • Optimize the methods of the widget checkbox CheckButton
    优化小部件复选框 CheckButton 的各项功能

  • The class Canvas adds parameters x and y to reduce redundant code
    Canvas 新增参数 xy 以减少多余代码

🟣 Fixed - 修复

  • Fixed a bug where widgets would misalign after calling the method moveto
    修复了小部件在调用了方法 moveto 后会发生错位的 bug

🔴 Removed - 移除

  • Remove Unused Constants SCALE
    删除无用常量 SCALE

🔖 2.6.0#

🕓 Release Date: 2023-03-28

🟢 Added - 新增

  • New virtual canvas widget check box: CheckButton
    新增虚拟画布小部件复选框:CheckButton

🟣 Fixed - 修复

  • Solve the bug that the Text class set and append methods will not be updated immediately after use
    解决 Textsetappend 方法使用后不会立即更新的 bug

🔵 Optimized - 优化

  • Optimize the parameters of some classes and functions
    优化部分类和函数的参数

🔖 2.5.12#

🕓 Release Date: 2023-03-20

🟢 Added - 新增

  • Add a image parameter to all widgets to add a background image
    所有小部件新增参数 image 来添加背景图片

🟣 Fixed - 修复

  • Fixed a bug where the move function cannot move a window
    修复了 move 函数无法移动窗口的 bug

🔵 Optimized - 优化

  • Move the binding code of the associated keyboard from class Tk to class Canvas
    将关联键盘的绑定代码全部由类 Tk 移到类 Canvas

  • Optimized some of the code to prevent bugs that shouldn’t occur
    优化了部分代码,防止出现一些不应该出现的 bug

🔴 Removed - 移除

  • Deleted function font
    删除了函数 font

🔖 2.5.11#

🕓 Release Date: 2023-03-13

🟢 Added - 新增

  • Class Canvas adds parameter keep to extend function
    Canvas 新增参数 keep 以扩展功能

  • Add the tool function SetProcessDpiAwareness to enhance the function
    新增工具函数 SetProcessDpiAwareness 以增强功能

  • New tool function font is added to solve the problem of font size matching DPI level
    新增工具函数 font 以解决字体大小适配 DPI 级别的问题

🟣 Fixed - 修复

  • Fixed the problem of inaccurate Python version requirements. The minimum module operation requirement should be Python 3.11
    修复了 Python 版本要求不准确的问题,模块最低运行要求应为 Python3.11

  • Fixed the problem that the configure method of _BaseWidget cannot get the normal effect when modifying the parameter text to an empty string
    修复了小部件基类 _BaseWidget 的方法 configure 在将参数 text 修改为空字符串时无法得到正常效果的问题

🔵 Optimized - 优化

  • Optimize the solution to the adaptive DPI problem
    优化解决适配 DPI 问题的方案

  • Optimized the way font size fits DPI
    优化了字体大小适配 DPI 的方式

  • The canvas widget will be scaled according to the scale of the canvas when it is placed, rather than after it is placed
    画布小部件在放置时就会根据画布的缩放而缩放,而不是在放置后才进行缩放

🔖 2.5.10#

🕓 Release Date: 2023-02-04

🟢 Added - 新增

  • Canvas virtual widget base class _BaseWidget Add instance attribute command_ex to extend functions
    画布虚拟小部件基类 _BaseWidget 新增实例属性 command_ex 以扩展功能

  • Function move adds parameter end to enhance function
    函数 move 新增参数 end 以增强功能

  • New method of canvas virtual widget base class moveto
    画布虚拟小部件基类新增方法 moveto

🟣 Fixed - 修复

  • Fixed the bug that the class Tk cannot make the distance between the window and the screen 0
    修复了类 Tk 无法使窗口与屏幕距离为 0 的 bug

  • Fixed the bug that the parameter borderwidth of the widget is invalid when it has rounded corners
    修复了小部件在有圆角状态下参数 borderwidth 失效的 bug

🟡 Changed - 变更

  • The initialization parameters of Tk class and Toplevel class have become more concise
    Tk 类和 Toplevel 类的初始化参数变得更加简洁了

🔵 Optimized - 优化

  • The state change of the canvas virtual widget adds a previous state detection, greatly improving performance
    画布虚拟小部件的状态改变加了个先前状态检测,大幅提高性能

  • The performance of function move has been optimized
    函数 move 的性能得到了优化

🔖 2.5.9#

🕓 Release Date: 2023-01-13

🟢 Added - 新增

  • Class PhotoImage new method stop is used to stop the playback of moving pictures
    PhotoImage 新增方法 stop 用于停止动图的播放

🟣 Fixed - 修复

  • Fixed an incomplete parameter bug in the moveto method of the Canvas class
    修复了 Canvas 类的方法 moveto 在参数上不完备的 bug

  • Fixed a bug that sometimes causes multiple widgets to touch at the same time
    修复了有时候会产生多个小部件同时触碰的 bug

  • Fixed parameter error of class PhotoImage
    修复了类 PhotoImage 的参数错误

🔵 Optimized - 优化

  • Optimize codes, simplify some codes and delete redundant parts
    优化代码,简化部分代码,删去冗余部分

🔴 Removed - 移除

  • The redundant parameters minsize and alpha of the Tk and Toplevel classes have been deleted
    删除了 Tk 类和 Toplevel 类的冗余参数 minsizealpha

🔖 2.5.8#

🕓 Release Date: 2023-01-12

🟣 Fixed - 修复

  • Fixed a bug that the function move cannot perform the default move mode flat
    修复了函数 move 无法进行默认的移动模式 flat 的 bug

  • Solve the bug that the cursor will flash faster and faster after pasting text for text widget
    解决文本类小部件在粘贴文本后光标会越闪越快的 bug

🔵 Optimized - 优化

  • move function has been optimized to improve applicability, accuracy and speed
    优化了 move 函数,提升了适用性、精度以及速度

  • Canvas class adds compatibility methods coords, move, moveto and bbox to improve the DPI adaptation problem
    Canvas 类新增兼容方法 coordsmovemovetobbox,完善了 DPI 的适配问题

  • Tk Class Add Method wm_minsize, wm_maxsize to be compatible with DPI adaptation problems
    Tk 类新增方法 wm_minsizewm_maxsize 以兼容 DPI 适配问题

  • Optimize the PhotoImage class so that it can be used without globalization
    优化 PhotoImage 类,使之无需全局化,即可使用

  • Overall optimization of code and reduction of code volume
    总体优化了代码,减少了代码量

🔖 2.5.7#

🕓 Release Date: 2023-01-10

🟢 Added - 新增

  • The move function adds the parameter frames, which can change the number of frames of the animation when moving
    move 函数新增参数 frames,可改变移动时的动画的帧数

  • Tk class adds the adaptation function to screen DPI, which can make the window clearer
    Tk 类新增对屏幕 DPI 的适配功能,可使窗口更加清晰

  • New compatible version and compatible version conversion file
    新增兼容版本以及兼容版本转换文件

🟡 Changed - 变更

  • Change the function names of functions move_widget, correct_text and change_color to move, text and color respectively
    分别将函数 move_widgetcorrect_textchange_color 的函数名变更为 movetextcolor

  • Corrected some parameters
    修正了些许参数

  • Increase the default frame rate parameter of the move function to 30
    提高了移动函数的默认帧率参数至 30

🔵 Optimized - 优化

  • Optimized the code structure of the color function and the move function to make it more concise
    优化了 color 函数和 move 函数的代码结构,使其更加简洁

🔖 2.5.6#

🕓 Release Date: 2022-12-12

🟣 Fixed - 修复

  • Fixed the bug that the singleton mode class (Singleton) could not pass parameters during initialization
    修复了单例模式类(Singleton)在初始化时无法传递参数的 bug

  • Fixed the bug that sometimes the font parameters of _CanvasItemId could not be found when scaling fonts in Canvas class
    修复了 Canvas 类在缩放字体时,有时会找不到 _CanvasItemId 的字体参数的 bug

🟡 Changed - 变更

  • The zoom method of the picture is changed from absolute zoom to relative absolute zoom
    图片的缩放方式由绝对缩放变更为相对的绝对缩放方式

🔵 Optimized - 优化

  • Optimized the structure of the PhotoImage class
    优化了 PhotoImage 类的结构

  • All useless codes (TODO marked) are deleted
    删除了所有无用的代码(TODO 标记的)

  • The fractions module is introduced to improve the precision of image scaling and reduce the operation time
    引入了 fractions 模块并提高了图片缩放时的精度且减少了运算时间

🔴 Removed - 移除

  • Canvas class deletes two redundant and overridden instance methods: create_ bitmap and create_ window
    Canvas 类删除了两个冗余的、重写的实例方法:create_bitmapcreate_window

🔖 2.5.5#

🕓 Release Date: 2022-12-11

🟢 Added - 新增

  • Added type prompt Self for the self parameter of instance methods of all classes
    为所有类的实例方法的 self 参数添加了类型提示 Self

🟣 Fixed - 修复

  • Fixed the bug that the width and height will not change in some cases when scaling Canvas classes
    修复了 Canvas 类缩放时,宽高在某些情况下不会改变的 bug

🟡 Changed - 变更

  • Modified the access method of Tk class, Toplevel class and Canvas class protection attributes
    修改了 Tk 类、Toplevel 类、Canvas 类的保护属性的获取方式

  • Greatly modified the canvas scaling mechanism, fully adapted to all situations, and accelerated the scaling speed
    大幅度地修改了画布缩放的机制,完全适应所有情况,并加快了缩放速度

🔵 Optimized - 优化

  • Optimize the structure of all multiple loops and judgment statements, making the code more beautiful
    优化了所有多重循环加判断语句的结构,使代码更为美观

🔖 2.5.4#

🕓 Release Date: 2022-12-08

🟢 Added - 新增

  • A new widget has been added: progress bar(Progressbar)
    增加了一个新的小部件:进度条(Progressbar

🟣 Fixed - 修复

  • Fixed the bug that the screen size would be abnormal when creating Canvas of different sizes
    修复了新建不同大小的 Canvas 时,画面大小会异常的 bug

  • Solved the bug that there is no change when the font size is scaled under certain conditions
    解决了字体大小进行缩放时,在某种条件下缩小没有变化的 bug

  • Solved the bug that function move_widget cannot move tkinter._CanvasItemId
    解决了函数 move_widget 无法移动 tkinter._CanvasItemId 的 bug

🟡 Changed - 变更

  • The binding mechanism of associated events has been modified so that Canvas classes can be created at any time
    修改了关联事件的绑定机制,使得 Canvas 类可以被随时创建

🔵 Optimized - 优化

  • Some colors are beautified
    美化了部分颜色

  • Optimized some codes in function move_widget
    优化了函数 move_widget 中的部分代码

🔖 2.5.3#

🕓 Release Date: 2022-11-27

🟢 Added - 新增

  • Added singleton pattern(Singleton) class for inheritance
    增加了单例模式类(Singleton)供继承

  • Add some methods (attributes) of Tk, Toplevel and Canvas to access some attributes that should not be directly accessed
    增加 TkToplevelCanvas 的一些方法(属性)来访问一些不应该被直接访问的属性

🟣 Fixed - 修复

  • Solved the bug that the destroy method of the widget can only delete half of the widgets when traversing
    解决了小部件的 destroy 方法在遍历使用时只能删除一半小部件的 bug
    💡 This bug was discovered by -ShuiGuang-

🔵 Optimized - 优化

  • Canvas class overrides destroy method to be compatible with the original destroy method
    Canvas 类重写 destroy 方法以兼容原 destroy 方法

  • Toplevel class overrides destroy method to be compatible with the original destroy method
    Toplevel 类重写 destroy 方法以兼容原 destroy 方法

  • Some codes of Tk and Toplevel are optimized, and the code amount of Toplevel widgets is greatly reduced
    优化了 TkToplevel 的部分代码,Toplevel 小部件的代码量大大缩减

🔴 Removed - 移除

  • The proportion_lock parameter and its function of Tk and Toplevel are deleted
    删除了 TkToplevelproportion_lock 参数及其功能

🔖 2.5.2#

🕓 Release Date: 2022-11-25

🟢 Added - 新增

  • Added mouse style for text type virtual widget
    添加了对文本类虚拟小部件的鼠标样式

🟣 Fixed - 修复

  • Solved the bug that the set and append methods of text virtual widgets may fail in some cases
    解决了文本类虚拟小部件 setappend 方法某些时候会失效的 bug

  • Solved the bug that the mouse style flickers when the mouse cursor moves over the button
    解决了鼠标光标移动到按钮上时的鼠标样式会闪烁的 bug

  • Fixed the bug that the read parameter of the text box widget failed
    修复了文本框小部件 read 参数失效的 bug

🔵 Optimized - 优化

  • Change the mouse position detection order to further improve the running speed
    改变鼠标位置检测顺序,进一步提升运行速度

🔖 2.5.1#

🕓 Release Date: 2022-11-23

🟢 Added - 新增

  • Added mouse style for button virtual widgets
    添加了对按钮虚拟小部件的鼠标样式

🟣 Fixed - 修复

  • Solved the bug that the input prompt position was not aligned after the input box was enlarged
    解决了输入框放大后输入提示符位置没对齐的 bug

  • Solved the bug that text virtual widgets will lose focus after being pasted once
    解决了文本类虚拟小部件粘贴一次后会失去焦点的 bug

  • Fix a few errors in the module documentation
    修复模块文档中的少许错误

🟡 Changed - 变更

  • Modified the mouse position determination mechanism and improved the running speed
    修改了鼠标位置判定机制,同时提升运行速度

🔵 Optimized - 优化

  • Some redundant codes are deleted to improve the overall running speed
    删除了部分冗余代码,提升总体运行速度

📑 Older Logs - 旧日志#

Note

The following logs belong to the ones found from ancient commit records, only date and version number, no specific content… Since I didn’t get into the habit of logging before, there are no more detailed logs, but fortunately the version number is inherited 😅
下面的日志属于从远古的提交记录中找到的,只有日期和版本号,没有具体的内容…… 由于我以前没有养成记录日志的习惯,故没有更多的详细的日志了,好在版本号继承了下来 😅

Version Release Date Description
2.5.0 2022-11-21 Upload the package to PyPi 🚀
2.4.15 2022-11-18 Drew and uploaded the first version of the logo
2.4.14 2022-11-14 -
2.4.11 2022-11-13 -
2.4.10 2022-11-10 -
2.4.2 2022-11-05 -
2.4.1 2022-11-03 -
2.4.0 2022-11-02 -
2.3.5 2022-11-01 -
2.3.1 2022-10-25 Added project license (MulanPSL-2)
2.3.0 2022-10-22 -
2.2.4 2022-10-20 -
2.2 2022-10-19 -
1.4 2022-09-21 -
1.3 2022-09-20 -
1.0 2022-09-10 The repository was created and uploaded 🎉
0.2 2022-08-29 Modularize codes gradually
0.1 2022-07-23 Where the dream begins!
\ No newline at end of file diff --git a/more/CODE_OF_CONDUCT/index.html b/more/CODE_OF_CONDUCT/index.html index b1c6d7f2..40e73b6f 100755 --- a/more/CODE_OF_CONDUCT/index.html +++ b/more/CODE_OF_CONDUCT/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Code of Conduct - 行为准则

约 682 个字 预计阅读时间 5 分钟

Our Pledge#

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards#

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others’ private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities#

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope#

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement#

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 2951256653@qq.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines#

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction#

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning#

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban#

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban#

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution#

This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Code of Conduct - 行为准则

约 682 个字 预计阅读时间 5 分钟

Our Pledge#

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards#

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others’ private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities#

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope#

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement#

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 2951256653@qq.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines#

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction#

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning#

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban#

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban#

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution#

This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

\ No newline at end of file diff --git a/more/CONTRIBUTING/index.html b/more/CONTRIBUTING/index.html index 31dbf55e..716dba7b 100755 --- a/more/CONTRIBUTING/index.html +++ b/more/CONTRIBUTING/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Contribution Guide - 贡献指南

约 1238 个字 预计阅读时间 8 分钟

First off, thanks for taking the time to contribute! ❤️
首先,感谢您抽出宝贵时间做出贡献!❤️

All types of contributions are encouraged and valued.Please see the table of contents below for details on the different ways to contribute and how to handle them. Be sure to read the relevant section before contributing, this will make it easier for our maintainers and make the experience smoother for everyone involved. We look forward to your contributions!
所有类型的贡献都是值得鼓励和重视的。请参阅下面的目录,了解不同的贡献方式及如何处理它们的详细信息。请务必在贡献前阅读相关部分,这将使我们的维护人员更容易,并使所有相关人员的体验更加顺畅。我们期待您的贡献!

Tip

If you like the project, but just don’t have time to contribute, that’s fine. There are other easy ways to support the project and show your gratitude, and we are also very happy, such as star the project!⭐
如果你喜欢这个项目,但只是没有时间做出贡献,那也没关系。还有其他简单的方法可以支持该项目并表达您的感激之情,我们也非常高兴,例如给这个项目加星标!⭐

❓ I Have a Question - 有个问题#

💡 Issue - 问题#

If you want to ask a question, we assume that you have read the available Documentation.If you still don’t find an answer you’re happy with, you can start an issue and we’ll get back to you as quickly as possible. However, before initiating an issue, please search for existing issues related to your issue to avoid initiating duplicate issues.
如果您想提出问题,我们假设您已经阅读了可用的文档。如果仍然没有找到您满意的答案,您可以发起一个 issue,我们将尽可能快地给出答复。但在发起 issue 之前,请先搜索是否存在已有 issue 与你的问题相关,以避免发起内容重复的 issue。

💬 Discussion - 讨论#

If you have any suggestions, etc., you can start a discussion in the discussion board. For example, you can start a discussion about a feature, discuss it with someone else or a project maintainer, and we will make improvements to the project based on the results of the discussion, or we may not take the suggestion.
如果你有什么建议等,你可以在讨论区发起一个讨论。比如你可以发起关于某项功能的讨论,与别人或者项目维护者进行相关的讨论,我们会根据讨论结果对项目进行相关改进,当然,也可能不会采纳相关建议。

✏️ I Want To Contribute - 想要贡献#

Warning

When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
在为本项目做出贡献时,您必须同意您创作了 100% 的内容,您对内容拥有必要的权利,并且您贡献的内容可以在项目许可下提供。

📝 Source Codes - 源代码#

  • It must be able to run stably in the latest stable version of the programming environment;
    必须保证能在最新稳定版本的编程环境下稳定运行;
  • The content must be relevant to the project;
    内容必须与项目相关;
  • The code style meets the requirements (see below);
    代码风格符合要求(见下文);
  • Include appropriate comments;
    包含适当的注释;
  • All in English, including docstrings;
    全部使用英语,包括文档字符串;

📑 Documents - 文档#

  • Correct, detailed, and easy to understand;
    正确、详细且通俗易懂;
  • Comply with certain specifications;
    符合一定的规范;
  • If possible, please translate into both English and Chinese;
    如果可能,请翻译为中英双语;

📖 Tutorials - 教程#

  • Accurate;
    准确无误;
  • Contains runnable sample code;
    包含可运行的示例代码;
  • The code must contain appropriate comments;
    代码必须包含适当的注释;
  • If possible, try not to use external resources (such as images, etc.);
    如果可能,代码尽量不要使用外部资源(如图片等);
  • If possible, please add pictures for illustrative purposes;
    如果可能,请加上用于解释说明的图片;
  • If possible, please translate into both English and Chinese;
    如果可能,请翻译为中英双语;

📚 Others - 其他内容#

  • Compliance with certain specifications is sufficient, depending on the circumstances;
    符合某些规范即可,具体视情况而定;

✨ What is the Style - 风格指南#

1️⃣ Code Style - 代码风格#

If you want your PR to be merged, we want your code style to be as official as possible, and if you can, we prefer your code to be in line with the project’s code style.
如果你想要你的 PR 被合并,我们希望你的代码风格尽量符合官方的风格,如果可以,我们更希望你的代码可以符合本项目的代码风格。

2️⃣ Other Style - 其它风格#

For other content, such as issues, we don’t make any stylistic requirements.
其它内容,如 issues 等,我们不对风格做任何要求。

🤝 Join The Project Team - 加入团队#

If you would like to join the project team, please contact the maintainers of the project team, here is some information about the authors of this project:
如果你想加入项目团队,请联系项目团队的维护人员,下面是本项目作者的一些信息:


This contribution guide is based on https://contributing.md/example/ .
这个贡献指南是基于 https://contributing.md/example/ 改写的。

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Contribution Guide - 贡献指南

约 1238 个字 预计阅读时间 8 分钟

First off, thanks for taking the time to contribute! ❤️
首先,感谢您抽出宝贵时间做出贡献!❤️

All types of contributions are encouraged and valued.Please see the table of contents below for details on the different ways to contribute and how to handle them. Be sure to read the relevant section before contributing, this will make it easier for our maintainers and make the experience smoother for everyone involved. We look forward to your contributions!
所有类型的贡献都是值得鼓励和重视的。请参阅下面的目录,了解不同的贡献方式及如何处理它们的详细信息。请务必在贡献前阅读相关部分,这将使我们的维护人员更容易,并使所有相关人员的体验更加顺畅。我们期待您的贡献!

Tip

If you like the project, but just don’t have time to contribute, that’s fine. There are other easy ways to support the project and show your gratitude, and we are also very happy, such as star the project!⭐
如果你喜欢这个项目,但只是没有时间做出贡献,那也没关系。还有其他简单的方法可以支持该项目并表达您的感激之情,我们也非常高兴,例如给这个项目加星标!⭐

❓ I Have a Question - 有个问题#

💡 Issue - 问题#

If you want to ask a question, we assume that you have read the available Documentation.If you still don’t find an answer you’re happy with, you can start an issue and we’ll get back to you as quickly as possible. However, before initiating an issue, please search for existing issues related to your issue to avoid initiating duplicate issues.
如果您想提出问题,我们假设您已经阅读了可用的文档。如果仍然没有找到您满意的答案,您可以发起一个 issue,我们将尽可能快地给出答复。但在发起 issue 之前,请先搜索是否存在已有 issue 与你的问题相关,以避免发起内容重复的 issue。

💬 Discussion - 讨论#

If you have any suggestions, etc., you can start a discussion in the discussion board. For example, you can start a discussion about a feature, discuss it with someone else or a project maintainer, and we will make improvements to the project based on the results of the discussion, or we may not take the suggestion.
如果你有什么建议等,你可以在讨论区发起一个讨论。比如你可以发起关于某项功能的讨论,与别人或者项目维护者进行相关的讨论,我们会根据讨论结果对项目进行相关改进,当然,也可能不会采纳相关建议。

✏️ I Want To Contribute - 想要贡献#

Warning

When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
在为本项目做出贡献时,您必须同意您创作了 100% 的内容,您对内容拥有必要的权利,并且您贡献的内容可以在项目许可下提供。

📝 Source Codes - 源代码#

  • It must be able to run stably in the latest stable version of the programming environment;
    必须保证能在最新稳定版本的编程环境下稳定运行;
  • The content must be relevant to the project;
    内容必须与项目相关;
  • The code style meets the requirements (see below);
    代码风格符合要求(见下文);
  • Include appropriate comments;
    包含适当的注释;
  • All in English, including docstrings;
    全部使用英语,包括文档字符串;

📑 Documents - 文档#

  • Correct, detailed, and easy to understand;
    正确、详细且通俗易懂;
  • Comply with certain specifications;
    符合一定的规范;
  • If possible, please translate into both English and Chinese;
    如果可能,请翻译为中英双语;

📖 Tutorials - 教程#

  • Accurate;
    准确无误;
  • Contains runnable sample code;
    包含可运行的示例代码;
  • The code must contain appropriate comments;
    代码必须包含适当的注释;
  • If possible, try not to use external resources (such as images, etc.);
    如果可能,代码尽量不要使用外部资源(如图片等);
  • If possible, please add pictures for illustrative purposes;
    如果可能,请加上用于解释说明的图片;
  • If possible, please translate into both English and Chinese;
    如果可能,请翻译为中英双语;

📚 Others - 其他内容#

  • Compliance with certain specifications is sufficient, depending on the circumstances;
    符合某些规范即可,具体视情况而定;

✨ What is the Style - 风格指南#

1️⃣ Code Style - 代码风格#

If you want your PR to be merged, we want your code style to be as official as possible, and if you can, we prefer your code to be in line with the project’s code style.
如果你想要你的 PR 被合并,我们希望你的代码风格尽量符合官方的风格,如果可以,我们更希望你的代码可以符合本项目的代码风格。

2️⃣ Other Style - 其它风格#

For other content, such as issues, we don’t make any stylistic requirements.
其它内容,如 issues 等,我们不对风格做任何要求。

🤝 Join The Project Team - 加入团队#

If you would like to join the project team, please contact the maintainers of the project team, here is some information about the authors of this project:
如果你想加入项目团队,请联系项目团队的维护人员,下面是本项目作者的一些信息:


This contribution guide is based on https://contributing.md/example/ .
这个贡献指南是基于 https://contributing.md/example/ 改写的。

\ No newline at end of file diff --git a/more/LICENSE/index.html b/more/LICENSE/index.html index c3d91b8f..da7a0821 100755 --- a/more/LICENSE/index.html +++ b/more/LICENSE/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

License - 项目许可证

约 170 个字 预计阅读时间 1 分钟

MIT License

Copyright © 2024 小康2022

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

License - 项目许可证

约 170 个字 预计阅读时间 1 分钟

MIT License

Copyright © 2024 小康2022

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

\ No newline at end of file diff --git a/more/SECURITY/index.html b/more/SECURITY/index.html index 248486e3..397bc736 100755 --- a/more/SECURITY/index.html +++ b/more/SECURITY/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Security Policy - 安全策略

约 130 个字 预计阅读时间 1 分钟

✅ Supported Versions - 支持的版本#

Only the latest stable version and the version under development are supported.
仅支持最新稳定版和正在开发的版本。

Version Supported
Latest Stable Version ✔️
Development Version ✔️
Other Versions

⚡ Reporting a Vulnerability - 报告漏洞#

In general, there are no security vulnerabilities and other related issues in this project…😅 But if so, please also contact the maintainers of this project in a private way, thank you!
一般来说嘞,本项目是没得安全漏洞以及相关的问题的……😅 但如果有哈,请以非公开的方式联系本项目的维护者,谢谢啦!

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Security Policy - 安全策略

约 130 个字 预计阅读时间 1 分钟

✅ Supported Versions - 支持的版本#

Only the latest stable version and the version under development are supported.
仅支持最新稳定版和正在开发的版本。

Version Supported
Latest Stable Version ✔️
Development Version ✔️
Other Versions

⚡ Reporting a Vulnerability - 报告漏洞#

In general, there are no security vulnerabilities and other related issues in this project…😅 But if so, please also contact the maintainers of this project in a private way, thank you!
一般来说嘞,本项目是没得安全漏洞以及相关的问题的……😅 但如果有哈,请以非公开的方式联系本项目的维护者,谢谢啦!

\ No newline at end of file diff --git a/more/TODO/index.html b/more/TODO/index.html index c66d8c7c..9f0b21f2 100755 --- a/more/TODO/index.html +++ b/more/TODO/index.html @@ -7,4 +7,4 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Todo - 任务清单

约 464 个字 预计阅读时间 3 分钟

Tip

Entries for this to-do item have the following 3 statuses:
此待办事项的条目有以下 3 种状态:

  • 🔥 In Development - 开发中
  • 📌 In Planning - 计划中
  • 💡 In Consideration - 考虑中

Items in development will most likely be implemented in the next release, planned items will be implemented in subsequent releases, and those under consideration may be added to the plan but may also be abandoned!
开发中的条目将大概率在下个版本中实现,计划中的将在后续版本中实现,考虑中的可能会被加入到计划中,但也可能被放弃!

🔥 In Development - 开发中#

  • Add docstrings
    添加文本字符串

  • Improve the basics of text widgets
    完善基础的文本类小部件

  • Add support for other color systems, such as HSV
    增加对其它颜色系统的支持,如 HSV

  • Add macOS theme style styling for built-in widgets
    增加内置小部件的 macOS 主题风格的样式

📌 In Planning - 计划中#

  • Improve compatibility of 3D subpackages with tkintertools 3
    提高 3D 子包对 tkintertools 3 的兼容性

  • Add slider widget
    增加滑动条小部件

  • Add text box widget
    增加文本框小部件

  • Add Tooltip widget
    增加提示框小部件

  • Add support for multiple image formats
    增加对多种格式图片的支持

  • Improve the 3D engine
    改善 3D 引擎

💡 In Consideration - 考虑中#

  • Add Physics engine
    增加物理引擎

  • Add a lighting system to the 3D subpackage
    在 3D 子包中增加光照系统

  • Add 2D engine (port and enhance turtle to tkintertools)
    增加 2D 引擎(移植并强化 turtletkintertools 中)

  • Add game system
    增加游戏系统

  • Introduce video-related third-party packages to enable video playback
    引入视频相关第三方包,以实现视频的播放

  • Introduce third-party web frameworks to enable web browsing
    引入第三方 Web 框架,以实现网页的浏览

  • Enables 3D subpackages to recognize and recall 3D files in STL or OBJ format
    让 3D 子包可识别并调用 STL 或 OBJ 格式的 3D 文件

  • Support application-level text language localization switching
    支持应用程序级别的文本语言本地化切换

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Todo - 任务清单

约 464 个字 预计阅读时间 3 分钟

Tip

Entries for this to-do item have the following 3 statuses:
此待办事项的条目有以下 3 种状态:

  • 🔥 In Development - 开发中
  • 📌 In Planning - 计划中
  • 💡 In Consideration - 考虑中

Items in development will most likely be implemented in the next release, planned items will be implemented in subsequent releases, and those under consideration may be added to the plan but may also be abandoned!
开发中的条目将大概率在下个版本中实现,计划中的将在后续版本中实现,考虑中的可能会被加入到计划中,但也可能被放弃!

🔥 In Development - 开发中#

  • Add docstrings
    添加文本字符串

  • Improve the basics of text widgets
    完善基础的文本类小部件

  • Add support for other color systems, such as HSV
    增加对其它颜色系统的支持,如 HSV

  • Add macOS theme style styling for built-in widgets
    增加内置小部件的 macOS 主题风格的样式

📌 In Planning - 计划中#

  • Improve compatibility of 3D subpackages with tkintertools 3
    提高 3D 子包对 tkintertools 3 的兼容性

  • Add slider widget
    增加滑动条小部件

  • Add text box widget
    增加文本框小部件

  • Add Tooltip widget
    增加提示框小部件

  • Add support for multiple image formats
    增加对多种格式图片的支持

  • Improve the 3D engine
    改善 3D 引擎

💡 In Consideration - 考虑中#

  • Add Physics engine
    增加物理引擎

  • Add a lighting system to the 3D subpackage
    在 3D 子包中增加光照系统

  • Add 2D engine (port and enhance turtle to tkintertools)
    增加 2D 引擎(移植并强化 turtletkintertools 中)

  • Add game system
    增加游戏系统

  • Introduce video-related third-party packages to enable video playback
    引入视频相关第三方包,以实现视频的播放

  • Introduce third-party web frameworks to enable web browsing
    引入第三方 Web 框架,以实现网页的浏览

  • Enables 3D subpackages to recognize and recall 3D files in STL or OBJ format
    让 3D 子包可识别并调用 STL 或 OBJ 格式的 3D 文件

  • Support application-level text language localization switching
    支持应用程序级别的文本语言本地化切换

\ No newline at end of file diff --git a/navigation/index.html b/navigation/index.html deleted file mode 100755 index 6a8c5eb3..00000000 --- a/navigation/index.html +++ /dev/null @@ -1,10 +0,0 @@ - Site Navigation - 站点导航 - tkintertools

Site Navigation - 站点导航

约 313 个字 预计阅读时间 2 分钟

Hi ~ Welcome to the official website of tkintertools! The most detailed and complete tutorials and detailed documentation are here!
嗨~欢迎来到 tkintertools 的官方网站!这里有最详细、最完整的使用教程和详细文档!

Tutorials - 教程#

Detailed official tutorial!(That’s what I wrote)
详细的官方教程!(就是我自己写的教程)

Warning - 警告

Unlike the corresponding version of tkintertools, there may be errors or other problems when running the relevant code!
不同于对应版本的 tkintertools 在运行相关代码时可能出现报错或者其他问题!

The tutorial is currently only partially updated, and it is only available in Chinese!
教程目前只更新了一部分内容,且只有中文版!

Documents - 文档#

Documents that correspond to the source code.
对应到源代码上的文档。

Note - 注意

Documentation will always be up-to-date!
文档将始终保持最新版本!

The language of the documentation is determined by the source code and there will be no translations!
文档语言由源代码决定,不会有任何翻译!

News - 新闻#

Update notes for each version!
关于各个版本的更新说明!

More - 更多#

Something else about the project!
关于项目的一些其他东西!


If you like - 如果你喜欢

If you think this project is good, please give me a thumbs up!
如果你觉得这个项目不错,还请为我点个赞噢!

\ No newline at end of file diff --git a/news/2.6.10/News/index.html b/news/2.6.10/News/index.html index 78c13667..318e15df 100755 --- a/news/2.6.10/News/index.html +++ b/news/2.6.10/News/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 611 个字 4 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.10
  • Release - 发布日期 : 2023/08/12
pip install tkintertools==2.6.10
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 611 个字 4 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.10
  • Release - 发布日期 : 2023/08/12
pip install tkintertools==2.6.10
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 22H2
  • Interpreter - 解释器 : Python 3.11.4

The following progress bar widget are in variable mode
下面的进度条控件为不定模式

png

Source Code - 源代码
# Only the key parts of the code are shown here
 
 pb = tkt.Progressbar(canvas, 320, 320, 640, 35, mode='indeterminate')  # indeterminate mode
diff --git a/news/2.6.11/News/index.html b/news/2.6.11/News/index.html
index 5a411a97..b527f733 100755
--- a/news/2.6.11/News/index.html
+++ b/news/2.6.11/News/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 640 个字 52 行代码 预计阅读时间 8 分钟

  • Version - 最新版本 : 2.6.11
  • Release - 发布日期 : 2023/10/17
pip install tkintertools==2.6.11
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 640 个字 52 行代码 预计阅读时间 8 分钟

  • Version - 最新版本 : 2.6.11
  • Release - 发布日期 : 2023/10/17
pip install tkintertools==2.6.11
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 22H2
  • Interpreter - 解释器 : Python 3.12.0

The following code has different results between the two versions, the result of 2.6.11 is significantly better than 2.6.10, and the improvement can be calculated by comparing the frame rate.
下面的代码在两个版本间的结果不同,2.6.11 的结果要优于 2.6.10,通过比较帧率可以计算得到提升效果。

说明

My computer configuration is low, the frame rate is for reference only, the instantaneous frame rate is not very stable, and my computer screenshots and other background operations are related, the specific results please refer to the average value. 我的电脑配置较低,帧率仅供参考,瞬时帧率不是非常稳定,与我电脑截屏和其他后台操作有关,具体结果请以平均值为准。

tkintertools 2.6.10 (FPS: 21.75, Avg: 23.42):

png

tkintertools 2.6.11 (FPS: 21.30, Avg: 26.15):

png

Source Code - 源代码
import random
 import time
 import tkintertools as tkt
diff --git a/news/2.6.12/News/index.html b/news/2.6.12/News/index.html
index e187c502..673826bf 100755
--- a/news/2.6.12/News/index.html
+++ b/news/2.6.12/News/index.html
@@ -7,5 +7,5 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 647 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.12
  • Release - 发布日期 : 2023/11/15
pip install tkintertools==2.6.12
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 647 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.12
  • Release - 发布日期 : 2023/11/15
pip install tkintertools==2.6.12
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 23H2
  • Interpreter - 解释器 : Python 3.12.0

The following are the docstrings displayed in tkintertools on Visual Studio Code and PyCharm, respectively.
以下分别是 Visual Studio Code 和 PyCharm 上 tkintertools 显示的 docstring。

Visual Studio Code:

VisualStudioCode.png

PyCharm:

PyCharm.png

ChangeLog - 更新日志#

Added - 新增#

  • Widget class CheckButton adds parameter tick to change its markup symbol
    控件类 CheckButton 新增参数 tick 来改变其标记符号

  • The Switch widget class adds parameters color_fill_slider and color_outline_slider to change the appearance of its internal sliders
    控件类 Switch 新增参数 color_fill_slidercolor_outline_slider 来更改其内部滑块的外观

Optimized - 优化#

  • Drastically changed the format of the docstring to solve the problem that the docstring was displayed out of order on PyCharm
    大幅度修改 docstring 的格式,以解决 docstring 在 PyCharm 上格式显示错乱的问题

  • Remove redundant code
    移除冗余代码

  • Optimized tools_3d submodule code to improve performance by 13.26%
    优化了 tools_3d 子模块代码,提高了 13.26% 的性能

Fixed - 修复#

  • Fixed an bug where when clicking on a widget, the widget behind it would also be triggered
    修复了点击控件时,其后面的控件也会被触发的问题

  • Missing symbol ‘#’ for function color return value
    函数 color 返回值缺少符号 “#”

  • Fixed an bug where the canvas of the tools_3d submodule could not use widgets such as buttons
    修复了 tools_3d 子模块的画布无法使用按钮等控件的问题

  • Fixed an bug where the Switch of the Widget class could not control the Switch by clicking on the inner slider
    修复了控件类 Switch 点击内部滑块无法操控 Switch 的问题

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming text widgets
    解决文本类控件缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.13/News/index.html b/news/2.6.13/News/index.html index 1cba46de..138b03d3 100755 --- a/news/2.6.13/News/index.html +++ b/news/2.6.13/News/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 735 个字 14 行代码 预计阅读时间 6 分钟

  • Version - 最新版本 : 2.6.13
  • Release - 发布日期 : 2023/11/17
pip install tkintertools==2.6.13
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 735 个字 14 行代码 预计阅读时间 6 分钟

  • Version - 最新版本 : 2.6.13
  • Release - 发布日期 : 2023/11/17
pip install tkintertools==2.6.13
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 23H2
  • Interpreter - 解释器 : Python 3.12.0

The following example shows the new feature markup text and 3D text:
以下样例展示了新功能标记文本和 3D 文本:

Note - 注意

Markup text is only accompanied by Point, and its text size does not change with the position of the Point, but 3D text is different in that its size changes with the spatial position, but it always faces us.

标记文本只是伴随着 Point,其文本大小并不会随着 Point 位置的变化而变化,但是 3D 文本不同,它的大小会随着空间位置变化而变化,但是它始终朝向我们。

png

Source Code - 源代码
import tkintertools as tkt
 from tkintertools import tools_3d as t3d
 
diff --git a/news/2.6.14/News/index.html b/news/2.6.14/News/index.html
index 1f02119f..884bfc4a 100755
--- a/news/2.6.14/News/index.html
+++ b/news/2.6.14/News/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 589 个字 129 行代码 预计阅读时间 13 分钟

  • Version - 最新版本 : 2.6.14
  • Release - 发布日期 : 2023/11/17
pip install tkintertools==2.6.14
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 589 个字 129 行代码 预计阅读时间 13 分钟

  • Version - 最新版本 : 2.6.14
  • Release - 发布日期 : 2023/11/17
pip install tkintertools==2.6.14
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 23H2
  • Interpreter - 解释器 : Python 3.12.0

Here’s what you can expect after improving the settings of each parameter of the widget and fixing many bugs:
下面是完善控件各个参数设定,修复了众多 bug 后所能呈现的效果:

png

The background is switched by the Switch action on the penultimate row.
背景的切换通过倒数第二行的控件 Switch 操作得到。

png

Source Code - 源代码
import webbrowser
 
 import tkintertools as tkt
diff --git a/news/2.6.15/News/index.html b/news/2.6.15/News/index.html
index 7a2b4b53..b0219015 100755
--- a/news/2.6.15/News/index.html
+++ b/news/2.6.15/News/index.html
@@ -7,5 +7,5 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 578 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.15
  • Release - 发布日期 : 2023/11/26
pip install tkintertools==2.6.15
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 578 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.15
  • Release - 发布日期 : 2023/11/26
pip install tkintertools==2.6.15
 

ChangeLog - 更新日志#

Added - 新增#

  • A new method for the Animation class is called shutdown to terminate the current animation
    Animation 新增方法 shutdown 来终止当前动画

  • The geometry class Cuboid and the geometry class Tetrahedron of submodule tools_3d have been initialized to increase the degree of freedom in style configuration
    子模块 tools_3d 的类 Cuboid 和类 Tetrahedron 新增一些初始化参数来提高样式配置的自由度

  • The constants TCL, PROPORTION, SEQLENGTH, and NUM are added
    新增常量 TCLPROPORTIONSEQLENGTHNUM

  • The color function adds the parameters seqlength and num to enhance the functionality
    函数 color 新增参数 seqlengthnum 来增强功能

Optimized - 优化#

  • The parameter support for the function color has been expanded to support color names such as red, skyblue, and cyan2
    函数 color 的参数支持的范围扩大,可以支持诸如 red、skyblue 和 cyan2 等颜色名称

  • Some functions can be called without the need for a parent widget
    部分函数无需父控件即可调用

Fixed - 修复#

  • Fixed a bug where the function color would get an incorrect result in rare cases
    修复了函数 color 在罕见情况下会得到错误结果的问题

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming text widgets
    解决文本类控件缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.16/News/index.html b/news/2.6.16/News/index.html index 29c01d0b..82997fe3 100755 --- a/news/2.6.16/News/index.html +++ b/news/2.6.16/News/index.html @@ -7,5 +7,5 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 508 个字 预计阅读时间 3 分钟

  • Version - 最新版本 : 2.6.16
  • Release - 发布日期 : 2023/12/01
pip install tkintertools==2.6.16
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 508 个字 预计阅读时间 3 分钟

  • Version - 最新版本 : 2.6.16
  • Release - 发布日期 : 2023/12/01
pip install tkintertools==2.6.16
 

ChangeLog - 更新日志#

Added - 新增#

  • The ToolTip class has added a delay parameter to enhance functionality
    ToolTip 新增参数 delay 来增强功能

Optimized - 优化#

  • The function askfont has been optimized so that the font selection dialog can now be opened without the need for a parent container widget
    对函数 askfont 进行了优化,现在无需父容器控件也可以打开字体选择对话框

Changed - 变更#

  • The values of some constants have been modified
    部分常量的值进行了修改

Removed - 移除#

  • Removed the function SetProcessDpiAwareness and the constant PROCESS_SYSTEM_DPI_AWARE
    移除函数 SetProcessDpiAwareness 和常量 PROCESS_SYSTEM_DPI_AWARE

Fixed - 修复#

  • Fixed the bug that the font size of the menu bar was abnormal
    修复菜单栏字体大小异常的问题

  • Fixed the bug that images could not be loaded
    修复图片无法加载的问题

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming text widgets
    解决文本类控件缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.17/News/index.html b/news/2.6.17/News/index.html index e1cf810e..abe63e05 100755 --- a/news/2.6.17/News/index.html +++ b/news/2.6.17/News/index.html @@ -7,5 +7,5 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 646 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.17
  • Release - 发布日期 : 2023/12/07
pip install tkintertools==2.6.17
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 646 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.17
  • Release - 发布日期 : 2023/12/07
pip install tkintertools==2.6.17
 

Attention - 特别注意

After that, there will be no new features in the Series 2 version, but there will still be optimizations and bug fixes, and by the end of the year, the Series 2 version will be completely retired!tkintertools for Series 3 is already in development, so stay tuned!

该版本之后,系列 2 版本将不会再新增任何功能,但仍会优化和修复 bug,到今年年底时,系列 2 版本将彻底停更!系列 3 的 tkintertools 已经在开发中了,敬请期待吧!

ChangeLog - 更新日志#

Optimized - 优化#

  • Corrected some incorrect English words
    修改了部分错误的英文单词

Changed - 变更#

  • The font unit changes from points to pixels
    字体单位由磅更改为像素

  • Reduced the display position offset of tooltip widgets
    减小了提示框控件的显示位置偏移

Fixed - 修复#

  • Fixed a bug where tooltip widgets could appear in very wrong places
    修复了提示框控件有可能显示在非常错误的位置的问题

  • Fixed a bug where the widget class Entry was in a non-centered state and the canvas was shrunk, entering an endless loop when entering text, causing the window to not respond
    修复了控件类 Entry 在非居中状态,且画布缩小之后,输入文本时进入死循环,导致窗口未响应的问题

  • Fixed a bug where widget color properties were sometimes unchangeable
    修复了控件颜色属性某些时候不可更改的问题

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming the Text class
    解决 Text 类缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.18/News/index.html b/news/2.6.18/News/index.html index e03fbbc6..4a007728 100755 --- a/news/2.6.18/News/index.html +++ b/news/2.6.18/News/index.html @@ -7,5 +7,5 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 426 个字 预计阅读时间 3 分钟

  • Version - 最新版本 : 2.6.18
  • Release - 发布日期 : 2023/12/10
pip install tkintertools==2.6.18
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 426 个字 预计阅读时间 3 分钟

  • Version - 最新版本 : 2.6.18
  • Release - 发布日期 : 2023/12/10
pip install tkintertools==2.6.18
 

ChangeLog - 更新日志#

Fixed - 修复#

  • Fixed a bug where the actual font size of 3D text with the same font size setting was inconsistent in different locations
    修复在不同位置的但字体大小设定相同的 3D 文本的实际字体大小不一致的 bug

Changed - 变更#

  • Class Canvas_3D was renamed Canvas3D, and Class _3D_Object was renamed to _Object3D
    Canvas_3D 更名为 Canvas3D,类 _3D_Object 更名为 _Object3D

Optimized - 优化#

  • Some codes have been optimized
    优化了部分代码

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming the Text class
    解决 Text 类缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.19/News/index.html b/news/2.6.19/News/index.html index 0d86e7b2..6bc4400b 100755 --- a/news/2.6.19/News/index.html +++ b/news/2.6.19/News/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 469 个字 18 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.19
  • Release - 发布日期 : 2023/12/17
pip install tkintertools==2.6.19
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 469 个字 18 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.19
  • Release - 发布日期 : 2023/12/17
pip install tkintertools==2.6.19
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 23H2
  • Interpreter - 解释器 : Python 3.12.0

The following action demonstrates the new use of the PhotoImage class:
下面的操作演示了类 PhotoImage 的新用法:

Example Code

import tkintertools as tkt
 
 root = tkt.Tk('PhotoImage Test', 1600, 900, 0, 0)
diff --git a/news/2.6.20/News/index.html b/news/2.6.20/News/index.html
index 7e116082..8f407bee 100755
--- a/news/2.6.20/News/index.html
+++ b/news/2.6.20/News/index.html
@@ -7,5 +7,5 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 587 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.20
  • Release - 发布日期 : 2023/12/26
pip install tkintertools==2.6.20
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 587 个字 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.20
  • Release - 发布日期 : 2023/12/26
pip install tkintertools==2.6.20
 

ChangeLog - 更新日志#

Optimized - 优化#

  • The pause and resume functionality of the image class PhotoImage is encapsulated in the methods pause and play
    图片类 PhotoImage 的暂停和继续播放功能被封装为方法 pauseplay

  • Optimized the way the PhotoImage class gets the total number of frames of a gif image, and now you can get the total number of frames by method get_total_frames
    优化类 PhotoImage 获取 gif 图片总帧数的方式,现在可以通过方法 get_total_frames 得到总帧数

  • The color function no longer manually obtains a gradient with a specified regularity, but instead specifies a control function through the parameter controller
    函数 color 不再通过手动方式得到指定规律的渐变色,而是通过参数 controller 指定一个控制函数

Changed - 变更#

  • The original method of play used for PhotoImage to start playback has been renamed to start to avoid conflicts with the method of play to continue playback
    图片类 PhotoImage 原来用于开始播放的方法 play 更名为 start 避免与继续播放的方法 play 起冲突

  • The constant CONTROL was renamed CONTROLLER
    常量 CONTROL 更名为 CONTROLLER

Fixed - 修复#

  • Fixed some incorrect type hints
    修复了一些错误的类型提示

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming the Text class
    解决 Text 类缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.21/News/index.html b/news/2.6.21/News/index.html index 9952879f..c748cc12 100755 --- a/news/2.6.21/News/index.html +++ b/news/2.6.21/News/index.html @@ -7,5 +7,5 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 529 个字 1 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.21
  • Release - 发布日期 : 2024/01/01
pip install tkintertools
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 529 个字 1 行代码 预计阅读时间 4 分钟

  • Version - 最新版本 : 2.6.21
  • Release - 发布日期 : 2024/01/01
pip install tkintertools
 

Attention - 特别注意

This will be the last version of tkintertools 2.* and will not be updated in any future! 这将是 tkintertools 2.* 的最后一个版本,后续将不再得到任何的更新!

tkintertools 3.0 will be available soon! tkintertools 3.0 将在不久后推出!

ChangeLog - 更新日志#

Changed - 变更#

  • The class Text in submodule tools_3d was renamed Text3D to distinguish Text in main
    子模块 tools_3d 中的类 Text 更名为 Text3D 以区分 main 中的 Text

Optimized - 优化#

  • Improved Type Hints
    完善了类型提示

Fixed - 修复#

  • Fixed a bug where the parameter proportion of the function color was invalid
    修复了函数 color 的参数 proportion 失效的问题

  • Fixed a bug where the configure parameter of the Switch class was incorrect 修复了类 Switch 的方法 configure 参数取值错误的问题

Removed - 移除#

  • Animation has removed the color parameter (can be implemented with the callback parameter)
    动画类 Animation 移除了参数 color(可用参数 callback 代替实现)

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Implement symmetry in 3D modules
    实现 3D 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

  • Change the underlying calculation of the 3D submodule from “Euler angle” to “quaternion” to improve performance
    改变 3D 子模块底层计算方式从“欧拉角”到“四元数”以提升性能

Known Bugs - 已知问题#

  • Solve the bug that text shrinks and overflows after zooming the Text class
    解决 Text 类缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

\ No newline at end of file diff --git a/news/2.6.6/News/index.html b/news/2.6.6/News/index.html index 397cf127..822007c5 100755 --- a/news/2.6.6/News/index.html +++ b/news/2.6.6/News/index.html @@ -7,5 +7,5 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 1099 个字 预计阅读时间 7 分钟

  • Version - 最新版本 : 2.6.6
  • Release - 发布日期 : 2023/07/01
pip install tkintertools==2.6.6
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 1099 个字 预计阅读时间 7 分钟

  • Version - 最新版本 : 2.6.6
  • Release - 发布日期 : 2023/07/01
pip install tkintertools==2.6.6
 

ChangeLog - 更新日志#

Added - 新增#

  • The classes _Point, _Line, _Side, and Geometry of the 3D submodule all have a new method center that returns the geometric center of the 3D object
    3D 子模块的类 _Point_Line_SideGeometry 都新增一个方法 center 返回该 3D 对象的几何中心

  • Added abstract class _3D_Object as the metabase class for classes _Point, _Line, and _Side
    新增抽象类 _3D_Object 来作为类 _Point_Line_Side 的元基类

Optimized - 优化#

  • Optimized parameter passing in 3D submodules, users do not need to ensure the transitivity of list at all times, and parameters that used to only use the list type are now Iterable type
    优化了 3D 子模块中的参数传递,使用者不需要时刻保证 list 的传递性,且原来只能使用 list 类型的参数现在为 Iterable 类型

  • The way 3D objects are centered in the 3D submodule has changed, which has improved performance and reduced the amount of code
    3D 子模块中 3D 对象居中方式改变,相比原来性能提升了不少,代码量也减少了

  • Corrected some incorrect type hints and improved some missing method comments
    改正了部分错误的类型提示,完善了部分缺少的方法注释

  • In the 3D submodule, the distance between two points was originally calculated with the function hypot, and now the function dist is used directly to calculate the Euclidean distance between two points to improve performance
    3D 子模块中原来用函数 hypot 计算两点间距离,现在直接用函数 dist 计算两点间欧几里得距离,提高性能

  • The position display of widgets of class Point has been optimized in the 3D submodule so that it is always at the forefront
    3D 子模块中优化了类 Point 的控件位置显示,让其始终保持在最前

  • The calculation formula for the camera distance in the 3D submodule has been optimized to improve the performance by a bit
    3D 子模块中相机距离的计算公式优化,提高了一点性能

Changed - 变更#

  • The parameters point1 and point2 of class Point of the 3D submodule and its parent class _Point were renamed to point_start and point_end respectively
    3D 子模块的类 Point 及其父类 _Point 的参数 point1point2 分别被重命名为 point_startpoint_end

  • The parameter origin_color of the class Space of the 3D submodule has been changed to four new parameters, namely origin_size, origin_width, origin_fill and origin_outline
    3D 子模块的类 Space 的参数 origin_color 被更改为四个新的参数,分别是 origin_sizeorigin_widthorigin_fillorigin_outline

Removed - 移除#

  • The classes Canvas_3D and Space of the 3D submodule remove the parameters dx and dy, and the default field of view of the canvas remains centered, i.e. their center is now the original upper-left vertex
    3D 子模块的类 Canvas_3DSpace 移除参数 dxdy,画布默认视野保持居中,也就是说,现在它们的中心位置才是原来的左上角顶点

Todos - 待办事项#

Possible Features - 期望功能#

  • Perfect the scroll bar function of Text class
    完善 Text 类的滚动条功能

  • Perfection and optimization of zoom function
    对缩放功能的完善和优化

  • Try adding a new widget: Switch
    尝试新增控件:开关 (Switch)

  • Try adding a new widget: ToolTip
    尝试新增控件:提示框 (ToolTip)

  • Try adding support for some MarkDown syntax
    尝试增加对部分 Markdown 语法的支持

  • Try adding a new pattern of no progress to the Progressbar widget
    尝试为进度条控件增加无进度的新模式

  • Implement symmetry in 3D modules
    实现 3d 模块中的对称功能

  • Enhanced projection functionality in 3D modules
    增强 3D 模块中的投影功能

  • Add more 3D spatial geometry classes
    增加更多 3D 空间几何体类

  • Add lights and achieve simple light and shadow renderings
    添加光源,并实现简单的光影渲染的效果

Known Bugs - 已知问题#

  • Solve the bug that the vertical position of the text is wrong when the Text class is enlarged
    解决 Text 类放大时,文本纵向位置错误的 bug

  • Solve the bug that text shrinks and overflows after zooming text widgets
    解决文本类控件缩放后文本产生缩水和溢出的 bug

  • Fix the bug of deletion misalignment when there is too much text in the Text class
    解决 Text 类中文本过多时删减错位的 bug

  • Fix the bug where the method place of class anvas did not work correctly
    解决类 Canvas 的方法 place 无法正常工作的 bug

  • The position relationship between the space before and after the 3D object is still problematic at some point
    3D 对象前后空间的位置关系在某些时候仍有问题

  • When creating a 3D object of concave geometry, calling its scale method displays an error
    创建凹面几何体的 3D 对象时,调用其 scale 方法会显示错误

\ No newline at end of file diff --git a/news/2.6.7/News/index.html b/news/2.6.7/News/index.html index 82fbbbf8..0e5adde0 100755 --- a/news/2.6.7/News/index.html +++ b/news/2.6.7/News/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Release Notes - 版本发布说明#

约 837 个字 51 行代码 预计阅读时间 9 分钟

  • Version - 最新版本 : 2.6.7
  • Release - 发布日期 : 2023/07/06
pip install tkintertools==2.6.7
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 837 个字 51 行代码 预计阅读时间 9 分钟

  • Version - 最新版本 : 2.6.7
  • Release - 发布日期 : 2023/07/06
pip install tkintertools==2.6.7
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 22H2
  • Interpreter - 解释器 : Python 3.11.4

Hold down the left mouse button and drag to rotate these multiple geometry;
按住鼠标左键拖动可以旋转这多个几何体;

Right-click and drag to move the position of these geometries in space;
按住鼠标右键拖动可以移动这些几何体在空间中的位置;

Scroll the middle mouse button to zoom in and out of the picture;
滚动鼠标中键可以放大和缩小画面;

These multiple geometries automatically rotate and float up and down;
这多个几何体会自动地旋转以及上下浮动;

gif

Source Code - 源代码
import math  # 数学支持
 
 import tkintertools as tkt  # 引入基础模块
diff --git a/news/2.6.8/News/index.html b/news/2.6.8/News/index.html
index 6b5e2550..a9817e1c 100755
--- a/news/2.6.8/News/index.html
+++ b/news/2.6.8/News/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 800 个字 39 行代码 预计阅读时间 8 分钟

  • Version - 最新版本 : 2.6.8
  • Release - 发布日期 : 2023/08/03
pip install tkintertools==2.6.8
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 800 个字 39 行代码 预计阅读时间 8 分钟

  • Version - 最新版本 : 2.6.8
  • Release - 发布日期 : 2023/08/03
pip install tkintertools==2.6.8
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 22H2
  • Interpreter - 解释器 : Python 3.11.4

Same effect as previous 2.6.7 version, but with less code!
效果与之前 2.6.7 版本相同,但是代码量更少!

gif

Source Code - 源代码
import math  # 数学支持
 
 import tkintertools as tkt  # 引入基础模块
diff --git a/news/2.6.9/News/index.html b/news/2.6.9/News/index.html
index 66520a32..e051025d 100755
--- a/news/2.6.9/News/index.html
+++ b/news/2.6.9/News/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 744 个字 5 行代码 预计阅读时间 5 分钟

  • Version - 最新版本 : 2.6.9
  • Release - 发布日期 : 2023/08/09
pip install tkintertools==2.6.9
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 744 个字 5 行代码 预计阅读时间 5 分钟

  • Version - 最新版本 : 2.6.9
  • Release - 发布日期 : 2023/08/09
pip install tkintertools==2.6.9
 

Example - 样例演示#

  • OS - 操作系统 : Windows11 22H2
  • Interpreter - 解释器 : Python 3.11.4

New widget: Switch! This widget allows you to adjust the length, width, color, and size of rounded corners!
新增控件:开关!这个控件可以调整长宽、颜色、以及圆角的大小!

png

Source Code - 源代码
# Only the key parts of the code are shown here
 
 tkt.Switch(canvas, 540, 420)
diff --git a/news/3.0.0/News/index.html b/news/3.0.0/News/index.html
index 70d20bf3..74ee9a2c 100755
--- a/news/3.0.0/News/index.html
+++ b/news/3.0.0/News/index.html
@@ -7,400 +7,399 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 1108 个字 393 行代码 预计阅读时间 34 分钟

Framework - 框架#

  • 🔖 Version - 最新版本 : 3.0.0.beta1
  • 🕓 Last Update - 上次更新 : 2024/05/17
pip install tkintertools==3.0.0b1
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 1108 个字 392 行代码 预计阅读时间 34 分钟

Framework - 框架#

  • 🔖 Version - 最新版本 : 3.0.0.beta1
  • 🕓 Last Update - 上次更新 : 2024/05/17
pip install tkintertools==3.0.0b1
 

Change Things - 更新内容#

🟢 Added - 新增

  • The docstrings for a portion of the code has been added
    添加了一部分代码的文本字符串

  • Added the animation class MoveItem to move items on the canvas
    增加了动画类 MoveItem 来移动画布上的 Item

  • The animation base class Animation adds the initialization parameter derivation to control whether the parameters of the callback function are derived
    动画基类 Animation 增加了初始化参数 derivation 来控制回调函数的参数是否求导

  • The subpackage color adds the module colormap to speed up the conversion of color names to their corresponding RGB codes
    子包 color 增加了模块 colormap 来加速颜色名称到其对应 RGB 码的转换速度

  • The subpackage color adds the functions contrast, convert, blend and gradient to complete the color processing mechanism
    子包 color 新增函数 contrastconvertblendgradient 来完善颜色处理机制的功能

  • The subpackage style adds the module theme to control the overall theme of the application
    子包 style 新增模块 theme 来控制应用程序整体的主题

  • Added method disabled to the widget class to disable it. If a style with a disabled state is defined in the stylesheet, the defined style is used, otherwise the style in the disabled state is automatically generated based on the current style (color to background color conversion by a factor of 0.618)
    小部件类新增方法 disabled 来使其处于禁用状态。若在样式表中定义了禁用状态的样式,则会使用定义的样式,否则根据当前样式自动生成禁用状态的样式(色彩向背景色转换 0.618 倍)

  • The widget RadioButton has a new initialization parameter default to control its default state
    小部件 RadioButton 新增初始化参数 default 来控制其默认的状态

  • Experimental support for color strings in RGBA format has been added to the Color subpackage
    颜色子包新增对 RGBA 格式的颜色字符串的实验性支持

🟣 Fixed - 修复

  • Fixed an bug where the animation classes MoveWidget and MoveComponent were not moving objects to the correct position when they were called repeatedly
    修复了动画类 MoveWidgetMoveComponent 在被反复调用的情况下无法将对象移动到正确位置的问题

  • Fixed an bug where the animation class ScaleFontSize did not scale the font size correctly
    修复了动画类 ScaleFontSize 无法正确缩放字体大小的问题

  • Fixed and enhanced a bug with the centering function of container widgets such as Toplevel
    修复并增强了容器小部件 Toplevel 等在居中功能上的问题

🔵 Optimized - 优化

  • Optimized the way to get the style file, the widget can set a relative name to reduce the amount of code, and the relative name starts with a decimal point
    优化了样式文件的获取方式,小组件可以设置相对名称来减少代码量,相对名称以小数点开头

  • The theme mechanism is optimized, there is no longer a need to write a tag in the style file, and the mapping relationship between the color parameters of the item and the keywords of the style file can be written in the definition of Shape, so as to reduce the redundant content in the style file and improve the compatibility between the style files
    主题机制优化,样式文件中不再需要写出 tag,可在 Shape 的定义中写明 Item 的颜色参数与样式文件关键字的映射关系,以此缩减样式文件中的冗余内容,提高各样式文件之间的兼容性

  • Optimized the appearance of some widgets
    优化部分小部件外观

  • Improved cross-platform compatibility
    提高了跨平台的兼容性

  • Improved 3D submodule compatibility with the new version of tkintertools
    提高了 3D 子模块对新版 tkintertools 兼容性

  • Change the constants FONT and SIZE to dynamic values, so that font modifications can take effect globally
    将常量 FONTSIZE 改成动态取值,便于字体修改可以全局生效

🟡 Changed - 变更

  • The animation class Gradient no longer converts an empty color string to black when it accepts it, but simply throws an exception
    动画类 Gradient 在接受空颜色字符串时不再将其转化为黑色,而是直接抛出异常

  • The implementation code for the 3D subpackage has been moved from file three/__init__.py to file three/engine.py
    3D 子包的实现代码从文件 three/__init__.py 移动到了文件 three/engine.py

  • The submodule style has been changed to the sub-package style and its contents have been reorganized
    子模块 style 变更为子包 style,其内容进行了重新的整理

🔴 Removed - 移除

  • Remove the useless class from the submodule images of the subpackage standard
    移除子包 standard 的子模块 images 中无用的类

  • Remove the function color from the color subpack (There are other better implementations)
    移除颜色子包中的函数 color(已有其他更好的实现)

🟤 Refactored - 重构

  • Some of the code has been refactored
    重构了部分代码

Preview - 预览#

Windows11#

png

png

Windows10#

png

png

macOS#

png

png

WSL#

png

png

Kubuntu#

png

png

Demo Code#

import itertools
 import math
 import random
 import statistics
-import tkinter.font as font
-import webbrowser
-
-import tkintertools as tkt
-import tkintertools.animation as animation
-import tkintertools.color as color
-import tkintertools.constants as constants
-import tkintertools.standard.dialogs as dialogs  # Customied
-import tkintertools.standard.features as features  # Customied
-import tkintertools.standard.shapes as shapes  # Customied
-import tkintertools.standard.texts as texts  # Customied
-import tkintertools.style as style
-import tkintertools.three as three
-
-root = tkt.Tk(title=f"tkintertools {tkt.__version__}")
-root.center()
-canvas = tkt.Canvas(root, zoom_item=True, keep_ratio="full",
-                    free_anchor=True, highlightthickness=1, highlightbackground="grey")
-canvas.place(width=1280, height=720, x=640, y=360, anchor="center")
-canvas.create_line(880, 0, 880, 800, fill="grey")
-
-# constants.SYSTEM = "Windows10"
-# constants.FONT = "霞鹜文楷 屏幕阅读版"
-
-ORIGIN_SYSTEM = constants.SYSTEM
-
-"""
-Data Card (RGBA - Experimental)
-"""
-
-_l = tkt.Label(canvas, (620, 390), (240, 310), name="")
-_l.shapes[0].styles = {"normal": {"fill": "#448AFF33", "outline": "#448AFF"},
-                       "hover": {"fill": "#00BFA533", "outline": "#00BFA5"}}
-_l.update()
-
-tkt.Information(canvas, (740, 430), text="— RGBA Card —")
-tkt.UnderlineButton(canvas, (740, 490), text="Home Page", through=True,
-                    command=lambda: webbrowser.open_new_tab("https://xiaokang2022.github.io/tkintertools/"))
-tkt.UnderlineButton(canvas, (740, 530), text="GitHub (Source)", through=True,
-                    command=lambda: webbrowser.open_new_tab("https://github.com/Xiaokang2022/tkintertools"))
-tkt.UnderlineButton(canvas, (740, 570), text="Gitee (Mirror)", through=True,
-                    command=lambda: webbrowser.open_new_tab("https://gitee.com/xiaokang-2022/tkintertools"))
-tkt.UnderlineButton(canvas, (740, 610), text="GitCode (Mirror)", through=True,
-                    command=lambda: webbrowser.open_new_tab("https://gitcode.com/Xiaokang2022/tkintertools"))
-tkt.UnderlineButton(canvas, (740, 650), text="Bug Reports", through=True,
-                    command=lambda: webbrowser.open_new_tab("https://github.com/Xiaokang2022/tkintertools/issues"))
+import webbrowser
+
+import tkintertools as tkt
+import tkintertools.animation as animation
+import tkintertools.color as color
+import tkintertools.constants as constants
+import tkintertools.standard.dialogs as dialogs  # Customied
+import tkintertools.standard.features as features  # Customied
+import tkintertools.standard.shapes as shapes  # Customied
+import tkintertools.standard.texts as texts  # Customied
+import tkintertools.style as style
+import tkintertools.three as three
+
+root = tkt.Tk(title=f"tkintertools {tkt.__version__}")
+root.center()
+canvas = tkt.Canvas(root, zoom_item=True, keep_ratio="full",
+                    free_anchor=True, highlightthickness=1, highlightbackground="grey")
+canvas.place(width=1280, height=720, x=640, y=360, anchor="center")
+canvas.create_line(880, 0, 880, 800, fill="grey")
+
+# constants.SYSTEM = "Windows10"
+# constants.FONT = "霞鹜文楷 屏幕阅读版"
+
+ORIGIN_SYSTEM = constants.SYSTEM
+
+"""
+Data Card (RGBA - Experimental)
+"""
+
+_l = tkt.Label(canvas, (620, 390), (240, 310), name="")
+_l.shapes[0].styles = {"normal": {"fill": "#448AFF33", "outline": "#448AFF"},
+                       "hover": {"fill": "#00BFA533", "outline": "#00BFA5"}}
+_l.update()
+
+tkt.Information(canvas, (740, 430), text="— RGBA Card —")
+tkt.UnderlineButton(canvas, (740, 490), text="Home Page", through=True,
+                    command=lambda: webbrowser.open_new_tab("https://xiaokang2022.github.io/tkintertools/"))
+tkt.UnderlineButton(canvas, (740, 530), text="GitHub (Source)", through=True,
+                    command=lambda: webbrowser.open_new_tab("https://github.com/Xiaokang2022/tkintertools"))
+tkt.UnderlineButton(canvas, (740, 570), text="Gitee (Mirror)", through=True,
+                    command=lambda: webbrowser.open_new_tab("https://gitee.com/xiaokang-2022/tkintertools"))
+tkt.UnderlineButton(canvas, (740, 610), text="GitCode (Mirror)", through=True,
+                    command=lambda: webbrowser.open_new_tab("https://gitcode.com/Xiaokang2022/tkintertools"))
+tkt.UnderlineButton(canvas, (740, 650), text="Bug Reports", through=True,
+                    command=lambda: webbrowser.open_new_tab("https://github.com/Xiaokang2022/tkintertools/issues"))
+
 
-
-"""
-Here's the customization section
-"""
+"""
+Here's the customization section
+"""
+
 
-
-class MyCustomWidget(tkt.Widget):
-    """"""
-
-    def __init__(self, *args, **kw) -> None:
-        super().__init__(*args, **kw)
+class MyCustomWidget(tkt.Widget):
+    """"""
+
+    def __init__(self, *args, **kw) -> None:
+        super().__init__(*args, **kw)
+
 
-
-class MyToplevel(tkt.Toplevel):
-    """My Customized Toplevel"""
-
-    def __init__(self, *args, **kw) -> None:
-        constants.SYSTEM = ORIGIN_SYSTEM
-        super().__init__(*args, size=(720, 405), **kw)
-        self.topmost(True)
-        self.center(self.master)
-        self.canvas = canvas = tkt.Canvas(self, free_anchor=True, expand="")
-        canvas.place(width=720, height=405, x=360, y=202, anchor="center")
-        canvas.create_rectangle(40, 40, 120, 120, dash="-", outline="grey")
-        canvas.create_text(80, 25, text="Shape", fill="grey")
-        self.s = canvas.create_text(80, 80, fill="red", justify="center")
-        canvas.create_line(120, 80, 180, 80, 180, 160, 220,
-                           160, fill="grey", arrow="last")
-        canvas.create_rectangle(40, 160, 120, 240, dash="-", outline="grey")
-        canvas.create_text(80, 145, text="Text", fill="grey")
-        canvas.create_line(120, 202.5, 220, 202.5, fill="grey", arrow="last")
-        canvas.create_rectangle(40, 280, 120, 360, dash="-", outline="grey")
-        canvas.create_text(80, 265, text="Image", fill="grey")
-        canvas.create_line(120, 320, 180, 320, 180, 240,
-                           220, 240, fill="grey", arrow="last")
-        canvas.create_rectangle(540, 40, 680, 120, dash="-", outline="grey")
-        canvas.create_text(610, 25, text="Feature", fill="grey")
-        self.f = canvas.create_text(610, 80, fill="purple")
-        canvas.create_line(610, 120, 610, 202.5, 500,
-                           202.5, fill="grey", arrow="last")
-        canvas.create_rectangle(220, 70, 500, 350, dash=".", outline="red")
-        canvas.create_text(360, 40, text="Widget", fill="red")
-
-        self.shape: tkt.Shape = None
-        self.text: tkt.Text = None
-        self.image: tkt.Image = None
-        self.feature: tkt.Feature = None
-        self.style: dict = None
-        self.widget: tkt.Widget = None
-
-        tkt.Button(canvas, (585, 275), text="Clear", command=self.clear)
-        tkt.Button(canvas, (585, 340), text="Generate", command=self.generate)
-
-    def generate(self) -> None:
-        """Generate a Widget randomly"""
-        self.clear()
-        self.shape = random.choice([shapes.Rectangle, shapes.Oval, shapes.Parallelogram, shapes.SharpRectangle,
-                                   shapes.RegularPolygon, shapes.RoundedRectangle, shapes.SemicircularRectangle])
-        self.feature = random.choice(
-            [features.Label, features.Button, features.UnderLine, features.Highlight])
-        self.text = texts.Information
-        self.widget = tkt.Widget(self.canvas, (300, 162), (120, 80))
-        kw = {}
-        match self.shape:
-            case shapes.RegularPolygon: kw["side"] = random.randint(3, 9)
-            case shapes.Parallelogram: kw["theta"] = random.uniform(-math.pi/6, math.pi/3)
-            case shapes.RoundedRectangle: kw["radius"] = random.randint(4, 25)
-            case shapes.SharpRectangle:
-                kw["theta"] = random.uniform(math.pi/6, math.pi/3)
-                kw["ratio"] = random.uniform(0, 1), random.uniform(0, 1)
-        try:
-            _s = self.shape(self.widget, **kw)
-            self.shape = self.shape(self.widget, (-280, -120), **kw)
-            _s.styles = self.shape.styles = {
-                "normal": {"fill": self.randcolor(), "outline": self.randcolor()},
-                "hover": {"fill": self.randcolor(), "outline": self.randcolor()},
-                "active": {"fill": self.randcolor(), "outline": self.randcolor()},
-            }
-        except:
-            self.canvas.itemconfigure(self.s, text="Param\nError")
-        _t = self.text(self.widget, text="TKT")
-        self.text = self.text(self.widget, (-280, 0), text="TKT")
-        _t.styles = self.text.styles = {
-            "normal": {"fill": self.randcolor()},
-            "hover": {"fill": self.randcolor()},
-            "active": {"fill": self.randcolor()},
-        }
-        self.canvas.itemconfigure(self.f, text=self.feature.__name__)
-        self.feature = self.feature(self.widget)
-        self.widget.update()
-
-    def randcolor(self) -> str:
-        """Get a random color string"""
-        num = random.randint(0, (1 << 24) - 1)
-        return f"#{num:06X}"
-
-    def clear(self) -> None:
-        """Clear Widget"""
-        if self.widget is not None:
-            self.widget.destroy()
-            self.widget = None
-        self.canvas.itemconfigure(self.s, text="")
-        self.canvas.itemconfigure(self.f, text="")
+class MyToplevel(tkt.Toplevel):
+    """My Customized Toplevel"""
+
+    def __init__(self, *args, **kw) -> None:
+        constants.SYSTEM = ORIGIN_SYSTEM
+        super().__init__(*args, size=(720, 405), **kw)
+        self.topmost(True)
+        self.center(self.master)
+        self.canvas = canvas = tkt.Canvas(self, free_anchor=True, expand="")
+        canvas.place(width=720, height=405, x=360, y=202, anchor="center")
+        canvas.create_rectangle(40, 40, 120, 120, dash="-", outline="grey")
+        canvas.create_text(80, 25, text="Shape", fill="grey")
+        self.s = canvas.create_text(80, 80, fill="red", justify="center")
+        canvas.create_line(120, 80, 180, 80, 180, 160, 220,
+                           160, fill="grey", arrow="last")
+        canvas.create_rectangle(40, 160, 120, 240, dash="-", outline="grey")
+        canvas.create_text(80, 145, text="Text", fill="grey")
+        canvas.create_line(120, 202.5, 220, 202.5, fill="grey", arrow="last")
+        canvas.create_rectangle(40, 280, 120, 360, dash="-", outline="grey")
+        canvas.create_text(80, 265, text="Image", fill="grey")
+        canvas.create_line(120, 320, 180, 320, 180, 240,
+                           220, 240, fill="grey", arrow="last")
+        canvas.create_rectangle(540, 40, 680, 120, dash="-", outline="grey")
+        canvas.create_text(610, 25, text="Feature", fill="grey")
+        self.f = canvas.create_text(610, 80, fill="purple")
+        canvas.create_line(610, 120, 610, 202.5, 500,
+                           202.5, fill="grey", arrow="last")
+        canvas.create_rectangle(220, 70, 500, 350, dash=".", outline="red")
+        canvas.create_text(360, 40, text="Widget", fill="red")
+
+        self.shape: tkt.Shape = None
+        self.text: tkt.Text = None
+        self.image: tkt.Image = None
+        self.feature: tkt.Feature = None
+        self.style: dict = None
+        self.widget: tkt.Widget = None
+
+        tkt.Button(canvas, (585, 275), text="Clear", command=self.clear)
+        tkt.Button(canvas, (585, 340), text="Generate", command=self.generate)
+
+    def generate(self) -> None:
+        """Generate a Widget randomly"""
+        self.clear()
+        self.shape = random.choice([shapes.Rectangle, shapes.Oval, shapes.Parallelogram, shapes.SharpRectangle,
+                                   shapes.RegularPolygon, shapes.RoundedRectangle, shapes.SemicircularRectangle])
+        self.feature = random.choice(
+            [features.Label, features.Button, features.UnderLine, features.Highlight])
+        self.text = texts.Information
+        self.widget = tkt.Widget(self.canvas, (300, 162), (120, 80))
+        kw = {}
+        match self.shape:
+            case shapes.RegularPolygon: kw["side"] = random.randint(3, 9)
+            case shapes.Parallelogram: kw["theta"] = random.uniform(-math.pi/6, math.pi/3)
+            case shapes.RoundedRectangle: kw["radius"] = random.randint(4, 25)
+            case shapes.SharpRectangle:
+                kw["theta"] = random.uniform(math.pi/6, math.pi/3)
+                kw["ratio"] = random.uniform(0, 1), random.uniform(0, 1)
+        try:
+            _s = self.shape(self.widget, **kw)
+            self.shape = self.shape(self.widget, (-280, -120), **kw)
+            _s.styles = self.shape.styles = {
+                "normal": {"fill": self.randcolor(), "outline": self.randcolor()},
+                "hover": {"fill": self.randcolor(), "outline": self.randcolor()},
+                "active": {"fill": self.randcolor(), "outline": self.randcolor()},
+            }
+        except:
+            self.canvas.itemconfigure(self.s, text="Param\nError")
+        _t = self.text(self.widget, text="TKT")
+        self.text = self.text(self.widget, (-280, 0), text="TKT")
+        _t.styles = self.text.styles = {
+            "normal": {"fill": self.randcolor()},
+            "hover": {"fill": self.randcolor()},
+            "active": {"fill": self.randcolor()},
+        }
+        self.canvas.itemconfigure(self.f, text=self.feature.__name__)
+        self.feature = self.feature(self.widget)
+        self.widget.update()
+
+    def randcolor(self) -> str:
+        """Get a random color string"""
+        num = random.randint(0, (1 << 24) - 1)
+        return f"#{num:06X}"
+
+    def clear(self) -> None:
+        """Clear Widget"""
+        if self.widget is not None:
+            self.widget.destroy()
+            self.widget = None
+        self.canvas.itemconfigure(self.s, text="")
+        self.canvas.itemconfigure(self.f, text="")
+
 
-
-"""
-Below is the section of the style following system
-"""
-
-tkt.Switch(canvas, (50, 35), command=lambda b: style.use_theme(
-    "dark" if b else "light"), default=style.DARK_MODE)
+"""
+Below is the section of the style following system
+"""
+
+tkt.Switch(canvas, (50, 35), command=lambda b: style.use_theme(
+    "dark" if b else "light"), default=style.DARK_MODE)
+
 
-
-i = canvas.create_text(
-    440, 50, text="tkintertools 3: a Brand New UI Framework", font=26)
-
-tkt.HighlightButton(canvas, (790, 50), text="Get More!", command=MyToplevel)
-
-tkt.Button(canvas, (900, 405), (360, 50),
-           text="Call a Nested Window", command=tkt.NestedToplevel)
-tkt.Button(canvas, (900, 465), (360, 50),
-           text="Call a Font Chooser", command=dialogs.FontChooser)
-tkt.Button(canvas, (900, 525), (360, 50),
-           text="Call a Color Chooser", command=dialogs.ColorChooser)
-
-info = tkt.Button(canvas, (900, 585), (175, 50), name="",
-                  text="Info", command=lambda: dialogs.Message(icon="info"))
-info.shapes[0].styles = {"normal": {"fill": "skyblue", "outline": "grey"}}
-info.update()
-question = tkt.Button(canvas, (900 + 185, 585), (175, 50), name="",
-                      text="Question", command=lambda: dialogs.Message(icon="question"))
-question.shapes[0].styles = {"normal": {
-    "fill": "lightgreen", "outline": "grey"}}
-question.update()
-warning = tkt.Button(canvas, (900, 645), (175, 50), name="",
-                     text="Warning", command=lambda: dialogs.Message(icon="warning"))
-warning.shapes[0].styles = {"normal": {"fill": "orange", "outline": "grey"}}
-warning.update()
-error = tkt.Button(canvas, (900 + 185, 645), (175, 50), name="",
-                   text="Error", command=lambda: dialogs.Message(icon="error"))
-error.shapes[0].styles = {"normal": {"fill": "red", "outline": "grey"}}
-error.update()
+i = canvas.create_text(
+    440, 50, text="tkintertools 3: a Brand New UI Framework", font=26)
+
+tkt.HighlightButton(canvas, (790, 50), text="Get More!", command=MyToplevel)
+
+tkt.Button(canvas, (900, 405), (360, 50),
+           text="Call a Nested Window", command=tkt.NestedToplevel)
+tkt.Button(canvas, (900, 465), (360, 50),
+           text="Call a Font Chooser", command=dialogs.FontChooser)
+tkt.Button(canvas, (900, 525), (360, 50),
+           text="Call a Color Chooser", command=dialogs.ColorChooser)
+
+info = tkt.Button(canvas, (900, 585), (175, 50), name="",
+                  text="Info", command=lambda: dialogs.Message(icon="info"))
+info.shapes[0].styles = {"normal": {"fill": "skyblue", "outline": "grey"}}
+info.update()
+question = tkt.Button(canvas, (900 + 185, 585), (175, 50), name="",
+                      text="Question", command=lambda: dialogs.Message(icon="question"))
+question.shapes[0].styles = {"normal": {
+    "fill": "lightgreen", "outline": "grey"}}
+question.update()
+warning = tkt.Button(canvas, (900, 645), (175, 50), name="",
+                     text="Warning", command=lambda: dialogs.Message(icon="warning"))
+warning.shapes[0].styles = {"normal": {"fill": "orange", "outline": "grey"}}
+warning.update()
+error = tkt.Button(canvas, (900 + 185, 645), (175, 50), name="",
+                   text="Error", command=lambda: dialogs.Message(icon="error"))
+error.shapes[0].styles = {"normal": {"fill": "red", "outline": "grey"}}
+error.update()
+
 
-
-random_color = f"#{random.randint(0, (1 << 24) - 1):06X}"
-contast_color = color.rgb_to_str(
-    color.contrast(color.str_to_rgb(random_color)))
+random_color = f"#{random.randint(0, (1 << 24) - 1):06X}"
+contast_color = color.rgb_to_str(
+    color.contrast(color.str_to_rgb(random_color)))
+
 
-
-animation.Gradient(canvas, i, "fill", 2000, (random_color, contast_color),
-                   repeat=-1, controller=lambda x: math.sin(x*math.pi)).start()
+animation.Gradient(canvas, i, "fill", 2000, (random_color, contast_color),
+                   repeat=-1, controller=lambda x: math.sin(x*math.pi)).start()
+
 
-
-"""
-Here's the part for customizing the system
-"""
+"""
+Here's the part for customizing the system
+"""
+
 
-
-constants.SYSTEM = "Windows11"
-
-tkt.Label(canvas, (50, 100), (120, 50), text="Label")
-tkt.Label(canvas, (180, 100), (120, 50), text="Label").disabled()
-l = tkt.Label(canvas, (310, 100), (120, 50), text="Label", name="")
-l.shapes[0].styles = {"normal": {"fill": "", "outline": "#5E8BDE"},
-                      "hover": {"fill": "", "outline": "#FFAC33"}}
-l.texts[0].styles = {"normal": {"fill": "#5E8BDE"},
-                     "hover": {"fill": "#FFAC33"}}
-l.update()
-
-tkt.Button(canvas, (50, 180), (120, 50), text="Button")
-tkt.Button(canvas, (180, 180), (120, 50), text="Button").disabled()
-b = tkt.Button(canvas, (310, 180), (120, 50), text="Button", name="")
-b.shapes[0].styles = {"normal": {"fill": "#5E8BDE", "outline": "#5E8BDE"},
-                      "hover": {"fill": "#CCCC00", "outline": "#CCCC00"},
-                      "active": {"fill": "#FFAC33", "outline": "#FFAC33"}}
-b.update()
-
-pb1 = tkt.ProgressBar(canvas, (50, 260), (380, 8))
-pb2 = tkt.ProgressBar(canvas, (50, 280), (380, 8), name="")
-
-pb2.shapes[0].styles = {"normal": {"fill": "", "outline": ""}}
-pb2.shapes[1].styles = {"normal": {"fill": "gold", "outline": "gold"}}
-pb2.shapes[1].disappear()
-pb2.update()
-
-animation.Animation(2000, animation.smooth, callback=pb1.set,
-                    fps=60, repeat=math.inf).start(delay=1500)
-animation.Animation(2000, animation.smooth, callback=pb2.set,
-                    fps=60, repeat=math.inf).start(delay=1000)
-
-pb3 = tkt.ProgressBar(canvas, (50, 315), (380, 20))
-pb4 = tkt.ProgressBar(canvas, (50, 350), (380, 20), name="")
-
-pb4.shapes[0].styles = {"normal": {"fill": "", "outline": "grey"}}
-pb4.shapes[1].styles = {"normal": {"fill": "pink", "outline": "pink"}}
-pb4.shapes[1].disappear()
-pb4.update()
-
-animation.Animation(2000, animation.smooth, callback=pb3.set,
-                    fps=60, repeat=math.inf).start(delay=500)
-animation.Animation(2000, animation.smooth, callback=pb4.set,
-                    fps=60, repeat=math.inf).start()
-
-tkt.CheckButton(canvas, (50, 390))
-tkt.Information(canvas, (165, 390 + 15), text="CheckButton")
-tkt.RadioButton(canvas, (250, 390 + 3))
-tkt.Information(canvas, (355, 390 + 15), text="RadioButton")
-tkt.Information(canvas, (460, 390 + 15), text="Off")
-tkt.Switch(canvas, (490, 390))
-tkt.Information(canvas, (580, 390 + 15), text="On")
-
-tkt.CheckButton(canvas, (50, 440), default=True).disabled()
-tkt.Information(canvas, (165, 440 + 15), text="CheckButton").disabled()
-tkt.RadioButton(canvas, (250, 440 + 3), default=True).disabled()
-tkt.Information(canvas, (355, 440 + 15), text="RadioButton").disabled()
-tkt.Information(canvas, (460, 440 + 15), text="Off").disabled()
-tkt.Switch(canvas, (490, 440), default=True).disabled()
-tkt.Information(canvas, (580, 440 + 15), text="On").disabled()
-
-tkt.Entry(canvas, (50, 595 - 5), (270, 50))
-e = tkt.Entry(canvas, (50, 655 - 5), (270, 50))
-e.set("Entry")
-e.disabled()
-
-constants.SYSTEM = "Windows10"
-
-tkt.Label(canvas, (50 + 410, 100), (120, 50), text="Label")
-tkt.Label(canvas, (180 + 410, 100), (120, 50), text="Label").disabled()
-tkt.Label(canvas, (310 + 410, 100), (120, 50), text="Label", name="")
-
-tkt.Button(canvas, (50 + 410, 180), (120, 50), text="Button")
-tkt.Button(canvas, (180 + 410, 180), (120, 50), text="Button").disabled()
-b2 = tkt.Button(canvas, (310 + 410, 180), (120, 50), text="Button", name="")
-
-b2.shapes[0].styles = {"normal": {"fill": "", "outline": ""},
-                       "hover": {"fill": "yellow", "outline": "red"}}
-b2.texts[0].styles = {"normal": {"fill": ""},
-                      "hover": {"fill": "black"}}
-b2.update()
-
-pb5 = tkt.ProgressBar(canvas, (50 + 410, 260), (380, 8))
-pb6 = tkt.ProgressBar(canvas, (50 + 410, 280), (380, 8), name="")
-
-pb6.shapes[0].styles = {"normal": {"fill": "orange", "outline": "orange"}}
-pb6.shapes[1].styles = {"normal": {"fill": "red", "outline": "red"}}
-pb6.shapes[1].disappear()
-pb6.update()
-
-animation.Animation(2000, animation.flat, callback=pb5.set,
-                    fps=60, repeat=math.inf).start()
-animation.Animation(2000, animation.flat, callback=pb6.set,
-                    fps=60, repeat=math.inf).start(delay=500)
-
-pb7 = tkt.ProgressBar(canvas, (50 + 410, 315), (380, 20))
-pb8 = tkt.ProgressBar(canvas, (50 + 410, 350), (380, 20), name="")
-
-pb8.shapes[0].styles = {"normal": {"fill": "", "outline": ""}}
-pb8.shapes[1].styles = {"normal": {"fill": "purple", "outline": "cyan"}}
-pb8.shapes[1].disappear()
-pb8.update()
-
-animation.Animation(2000, animation.flat, callback=pb7.set,
-                    fps=60, repeat=math.inf).start(delay=1000)
-animation.Animation(2000, animation.flat, callback=pb8.set,
-                    fps=60, repeat=math.inf).start(delay=1500)
-
-tkt.CheckButton(canvas, (50, 490))
-tkt.Information(canvas, (165, 490 + 15), text="CheckButton")
-tkt.RadioButton(canvas, (250, 490 + 3))
-tkt.Information(canvas, (355, 490 + 15), text="RadioButton")
-tkt.Information(canvas, (460, 490 + 15), text="Off")
-tkt.Switch(canvas, (490, 490))
-tkt.Information(canvas, (580, 490 + 15), text="On")
-
-tkt.CheckButton(canvas, (50, 540)).disabled()
-tkt.Information(canvas, (165, 540 + 15), text="CheckButton").disabled()
-tkt.RadioButton(canvas, (250, 540 + 3)).disabled()
-tkt.Information(canvas, (355, 540 + 15), text="RadioButton").disabled()
-tkt.Information(canvas, (460, 540 + 15), text="Off").disabled()
-tkt.Switch(canvas, (490, 540)).disabled()
-tkt.Information(canvas, (580, 540 + 15), text="On").disabled()
-
-tkt.Entry(canvas, (50 + 280, 595 - 5), (270, 50))
-tkt.Entry(canvas, (50 + 280, 655 - 5), (270, 50)).disabled()
-
-"""
-Here's the 3D part
-"""
+constants.SYSTEM = "Windows11"
+
+tkt.Label(canvas, (50, 100), (120, 50), text="Label")
+tkt.Label(canvas, (180, 100), (120, 50), text="Label").disabled()
+l = tkt.Label(canvas, (310, 100), (120, 50), text="Label", name="")
+l.shapes[0].styles = {"normal": {"fill": "", "outline": "#5E8BDE"},
+                      "hover": {"fill": "", "outline": "#FFAC33"}}
+l.texts[0].styles = {"normal": {"fill": "#5E8BDE"},
+                     "hover": {"fill": "#FFAC33"}}
+l.update()
+
+tkt.Button(canvas, (50, 180), (120, 50), text="Button")
+tkt.Button(canvas, (180, 180), (120, 50), text="Button").disabled()
+b = tkt.Button(canvas, (310, 180), (120, 50), text="Button", name="")
+b.shapes[0].styles = {"normal": {"fill": "#5E8BDE", "outline": "#5E8BDE"},
+                      "hover": {"fill": "#CCCC00", "outline": "#CCCC00"},
+                      "active": {"fill": "#FFAC33", "outline": "#FFAC33"}}
+b.update()
+
+pb1 = tkt.ProgressBar(canvas, (50, 260), (380, 8))
+pb2 = tkt.ProgressBar(canvas, (50, 280), (380, 8), name="")
+
+pb2.shapes[0].styles = {"normal": {"fill": "", "outline": ""}}
+pb2.shapes[1].styles = {"normal": {"fill": "gold", "outline": "gold"}}
+pb2.shapes[1].disappear()
+pb2.update()
+
+animation.Animation(2000, animation.smooth, callback=pb1.set,
+                    fps=60, repeat=math.inf).start(delay=1500)
+animation.Animation(2000, animation.smooth, callback=pb2.set,
+                    fps=60, repeat=math.inf).start(delay=1000)
+
+pb3 = tkt.ProgressBar(canvas, (50, 315), (380, 20))
+pb4 = tkt.ProgressBar(canvas, (50, 350), (380, 20), name="")
+
+pb4.shapes[0].styles = {"normal": {"fill": "", "outline": "grey"}}
+pb4.shapes[1].styles = {"normal": {"fill": "pink", "outline": "pink"}}
+pb4.shapes[1].disappear()
+pb4.update()
+
+animation.Animation(2000, animation.smooth, callback=pb3.set,
+                    fps=60, repeat=math.inf).start(delay=500)
+animation.Animation(2000, animation.smooth, callback=pb4.set,
+                    fps=60, repeat=math.inf).start()
+
+tkt.CheckButton(canvas, (50, 390))
+tkt.Information(canvas, (165, 390 + 15), text="CheckButton")
+tkt.RadioButton(canvas, (250, 390 + 3))
+tkt.Information(canvas, (355, 390 + 15), text="RadioButton")
+tkt.Information(canvas, (460, 390 + 15), text="Off")
+tkt.Switch(canvas, (490, 390))
+tkt.Information(canvas, (580, 390 + 15), text="On")
+
+tkt.CheckButton(canvas, (50, 440), default=True).disabled()
+tkt.Information(canvas, (165, 440 + 15), text="CheckButton").disabled()
+tkt.RadioButton(canvas, (250, 440 + 3), default=True).disabled()
+tkt.Information(canvas, (355, 440 + 15), text="RadioButton").disabled()
+tkt.Information(canvas, (460, 440 + 15), text="Off").disabled()
+tkt.Switch(canvas, (490, 440), default=True).disabled()
+tkt.Information(canvas, (580, 440 + 15), text="On").disabled()
+
+tkt.Entry(canvas, (50, 595 - 5), (270, 50))
+e = tkt.Entry(canvas, (50, 655 - 5), (270, 50))
+e.set("Entry")
+e.disabled()
+
+constants.SYSTEM = "Windows10"
+
+tkt.Label(canvas, (50 + 410, 100), (120, 50), text="Label")
+tkt.Label(canvas, (180 + 410, 100), (120, 50), text="Label").disabled()
+tkt.Label(canvas, (310 + 410, 100), (120, 50), text="Label", name="")
+
+tkt.Button(canvas, (50 + 410, 180), (120, 50), text="Button")
+tkt.Button(canvas, (180 + 410, 180), (120, 50), text="Button").disabled()
+b2 = tkt.Button(canvas, (310 + 410, 180), (120, 50), text="Button", name="")
+
+b2.shapes[0].styles = {"normal": {"fill": "", "outline": ""},
+                       "hover": {"fill": "yellow", "outline": "red"}}
+b2.texts[0].styles = {"normal": {"fill": ""},
+                      "hover": {"fill": "black"}}
+b2.update()
+
+pb5 = tkt.ProgressBar(canvas, (50 + 410, 260), (380, 8))
+pb6 = tkt.ProgressBar(canvas, (50 + 410, 280), (380, 8), name="")
+
+pb6.shapes[0].styles = {"normal": {"fill": "orange", "outline": "orange"}}
+pb6.shapes[1].styles = {"normal": {"fill": "red", "outline": "red"}}
+pb6.shapes[1].disappear()
+pb6.update()
+
+animation.Animation(2000, animation.flat, callback=pb5.set,
+                    fps=60, repeat=math.inf).start()
+animation.Animation(2000, animation.flat, callback=pb6.set,
+                    fps=60, repeat=math.inf).start(delay=500)
+
+pb7 = tkt.ProgressBar(canvas, (50 + 410, 315), (380, 20))
+pb8 = tkt.ProgressBar(canvas, (50 + 410, 350), (380, 20), name="")
+
+pb8.shapes[0].styles = {"normal": {"fill": "", "outline": ""}}
+pb8.shapes[1].styles = {"normal": {"fill": "purple", "outline": "cyan"}}
+pb8.shapes[1].disappear()
+pb8.update()
+
+animation.Animation(2000, animation.flat, callback=pb7.set,
+                    fps=60, repeat=math.inf).start(delay=1000)
+animation.Animation(2000, animation.flat, callback=pb8.set,
+                    fps=60, repeat=math.inf).start(delay=1500)
+
+tkt.CheckButton(canvas, (50, 490))
+tkt.Information(canvas, (165, 490 + 15), text="CheckButton")
+tkt.RadioButton(canvas, (250, 490 + 3))
+tkt.Information(canvas, (355, 490 + 15), text="RadioButton")
+tkt.Information(canvas, (460, 490 + 15), text="Off")
+tkt.Switch(canvas, (490, 490))
+tkt.Information(canvas, (580, 490 + 15), text="On")
+
+tkt.CheckButton(canvas, (50, 540)).disabled()
+tkt.Information(canvas, (165, 540 + 15), text="CheckButton").disabled()
+tkt.RadioButton(canvas, (250, 540 + 3)).disabled()
+tkt.Information(canvas, (355, 540 + 15), text="RadioButton").disabled()
+tkt.Information(canvas, (460, 540 + 15), text="Off").disabled()
+tkt.Switch(canvas, (490, 540)).disabled()
+tkt.Information(canvas, (580, 540 + 15), text="On").disabled()
+
+tkt.Entry(canvas, (50 + 280, 595 - 5), (270, 50))
+tkt.Entry(canvas, (50 + 280, 655 - 5), (270, 50)).disabled()
+
+"""
+Here's the 3D part
+"""
+
 
-
-space = three.Space(canvas, free_anchor=True, zoom_item=True,
-                    highlightthickness=1, highlightbackground="grey")
-space.place(width=360, height=360, x=900, y=20)
-space.update()
-
-m = 150 * math.sqrt(50 - 10 * math.sqrt(5)) / 10
-n = 150 * math.sqrt(50 + 10 * math.sqrt(5)) / 10
-points = []
-dis_side = 150 * (3 * math.sqrt(3) + math.sqrt(15)) / 12 / \
-    ((math.sqrt(10 + 2 * math.sqrt(5))) / 4)
-count, color_lst = 0, ['00', '77', 'FF']
-colors = [f'#{r}{g}{b}' for r in color_lst for g in color_lst for b in color_lst]
-
-for i in m, -m:
-    for j in n, -n:
-        points.append([0, j, i])
-        points.append([i, 0, j])
-        points.append([j, i, 0])
-
-for p in itertools.combinations(points, 3):
-    dis = math.hypot(*[statistics.mean(c[i] for c in p) for i in range(3)])
-    if math.isclose(dis, dis_side):
-        three.Side(space, *p, fill=colors[count], outline='grey')
-        count += 1
+space = three.Space(canvas, free_anchor=True, zoom_item=True,
+                    highlightthickness=1, highlightbackground="grey")
+space.place(width=360, height=360, x=900, y=20)
+space.update()
+
+m = 150 * math.sqrt(50 - 10 * math.sqrt(5)) / 10
+n = 150 * math.sqrt(50 + 10 * math.sqrt(5)) / 10
+points = []
+dis_side = 150 * (3 * math.sqrt(3) + math.sqrt(15)) / 12 / \
+    ((math.sqrt(10 + 2 * math.sqrt(5))) / 4)
+count, color_lst = 0, ['00', '77', 'FF']
+colors = [f'#{r}{g}{b}' for r in color_lst for g in color_lst for b in color_lst]
+
+for i in m, -m:
+    for j in n, -n:
+        points.append([0, j, i])
+        points.append([i, 0, j])
+        points.append([j, i, 0])
+
+for p in itertools.combinations(points, 3):
+    dis = math.hypot(*[statistics.mean(c[i] for c in p) for i in range(3)])
+    if math.isclose(dis, dis_side):
+        three.Side(space, *p, fill=colors[count], outline='grey')
+        count += 1
+
 
-
-space.space_sort()
+space.space_sort()
+
 
-
-count = 0
+count = 0
+
 
-
-def _callback(_: float) -> None:
-    """callback function of animation"""
-    global count
-    count += 0.08
-    for item in space.items_3d():
-        item.rotate(dy=-0.01, dz=0.02)
-        item.translate(dz=math.sin(count))
-        item.update()
-    space.space_sort()
+def _callback(_: float) -> None:
+    """callback function of animation"""
+    global count
+    count += 0.08
+    for item in space.items_3d():
+        item.rotate(dy=-0.01, dz=0.02)
+        item.translate(dz=math.sin(count))
+        item.update()
+    space.space_sort()
+
 
-
-an = animation.Animation(2000, animation.flat, callback=_callback,
-                         fps=60, repeat=-1, derivation=True)
+an = animation.Animation(2000, animation.flat, callback=_callback,
+                         fps=60, repeat=-1, derivation=True)
+
 
-
-tkt.Switch(space, (10, 10), command=lambda flag: an.start()
-           if flag else an.stop())
-
-root.mainloop()
-

欢迎在评论区留下你的想法

Chess 🚀#

约 413 个字 预计阅读时间 3 分钟

A Chinese chess program based on tkintertools and written in Python 3.12 and C++ 20.

This program is implemented using a mix of tkinter and tkintertools modules, tkintertools is a third-party Python module that I developed on my own to beautify tkinter and provide some advanced features! 🎉

Note

Since the original program was written by me one year ago, the tkintertools module uses the test version, and the AI of the program was added later, and the previous code quality is relatively poor, please understand. 😅

Star History#

Star History Chart

How to use#

Before use#

Info

Make sure your Python version is 3.12 or greater and C++ version is 20 or greater.

Choose the mode#

run the main.py and choose a game mode you want.

I’ve provided 4 modes, Three of them can be selected in “新游戏”,and “残局挑战” needs to be selected in the “棋局库”.

One last step#

have fun! 😁

Brief introduction#

Base Features#

  1. Two-player match
  2. Man-machine battles
  3. Endgame Challenge
  4. LAN connection

About the AI#

I’ve provided 2 AI algorithms, one of which also provides an implementation of C++20:

  1. Minimum-Max search algorithm
    • Python: min_max_search.py
  2. Alpha-beta pruning algorithm
    • Python: alpha_beta_search.py
    • C++ (default):
      • src: ./cpp/HelloWorld.cpp
      • dll: ./PyDLL.dll

You can change them in the settings. By the way, default value of the search depth is 4.

Tip

Due to the smaller number of pieces in endgame mode, the search space is smaller, and you can increase the AI’s search depth a little more, and the results could be even better!

Danger

You can also modify the pieces of the individual AI algorithms to evaluate the scores if you want, but be careful not to set the score to a limit value (like math.inf), which will cause the algorithm to not come up with the correct result!

Some really great features#

When you’re playing chess, the terminal actually has an output! For example:

SCORE: 2
STEP: 5
〇〇象士将士象马车
〇〇〇〇〇〇〇〇
炮马〇〇〇〇

〇〇〇〇〇〇〇〇〇
〇〇〇〇〇〇〇〇〇

〇〇〇〇
〇〇〇〇〇〇〇〇〇
車相仕帥仕相馬車

It provides a very clear picture of the game state and the current AI score.

Warning

Some of the pictures and other resources involved in the project come from the Internet and are not used for commercial purposes.
Please contact me for infringement: 2951256653@qq.com


If you want to know more about this program, see: https://xiaokang2022.blog.csdn.net/article/details/128852029

\ No newline at end of file + body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Chess 🚀#

约 413 个字 预计阅读时间 3 分钟

A Chinese chess program based on tkintertools and written in Python 3.12 and C++ 20.

This program is implemented using a mix of tkinter and tkintertools modules, tkintertools is a third-party Python module that I developed on my own to beautify tkinter and provide some advanced features! 🎉

Note

Since the original program was written by me one year ago, the tkintertools module uses the test version, and the AI of the program was added later, and the previous code quality is relatively poor, please understand. 😅

Star History#

Star History Chart

How to use#

Before use#

Info

Make sure your Python version is 3.12 or greater and C++ version is 20 or greater.

Choose the mode#

run the main.py and choose a game mode you want.

I’ve provided 4 modes, Three of them can be selected in “新游戏”,and “残局挑战” needs to be selected in the “棋局库”.

One last step#

have fun! 😁

Brief introduction#

Base Features#

  1. Two-player match
  2. Man-machine battles
  3. Endgame Challenge
  4. LAN connection

About the AI#

I’ve provided 2 AI algorithms, one of which also provides an implementation of C++20:

  1. Minimum-Max search algorithm
    • Python: min_max_search.py
  2. Alpha-beta pruning algorithm
    • Python: alpha_beta_search.py
    • C++ (default):
      • src: ./cpp/HelloWorld.cpp
      • dll: ./PyDLL.dll

You can change them in the settings. By the way, default value of the search depth is 4.

Tip

Due to the smaller number of pieces in endgame mode, the search space is smaller, and you can increase the AI’s search depth a little more, and the results could be even better!

Danger

You can also modify the pieces of the individual AI algorithms to evaluate the scores if you want, but be careful not to set the score to a limit value (like math.inf), which will cause the algorithm to not come up with the correct result!

Some really great features#

When you’re playing chess, the terminal actually has an output! For example:

SCORE: 2
STEP: 5
〇〇象士将士象马车
〇〇〇〇〇〇〇〇
炮马〇〇〇〇

〇〇〇〇〇〇〇〇〇
〇〇〇〇〇〇〇〇〇

〇〇〇〇
〇〇〇〇〇〇〇〇〇
車相仕帥仕相馬車

It provides a very clear picture of the game state and the current AI score.

Warning

Some of the pictures and other resources involved in the project come from the Internet and are not used for commercial purposes.
Please contact me for infringement: 2951256653@qq.com


If you want to know more about this program, see: https://xiaokang2022.blog.csdn.net/article/details/128852029

\ No newline at end of file diff --git a/projects/Intelligent Magic Cube/index.html b/projects/Intelligent Magic Cube/index.html index f100d7d5..fd7dd221 100755 --- a/projects/Intelligent Magic Cube/index.html +++ b/projects/Intelligent Magic Cube/index.html @@ -7,6 +7,6 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Intelligent Magic Cube 🚀#

约 221 个字 2 行代码 预计阅读时间 2 分钟

A variety of intelligent search algorithms visually restore the 3D Magic Cube.

Note

This program is implemented by tkinter in combination with the third-party library tkintertools. tkintertools is a third-party library developed by me, I hope you will support me a lot!

Star History#

Star History Chart

How to use#

Before use#

Info

Make sure your Python version is 3.12 or greater.

Install dependency#

Install the third-party library tkintertools:

pip install tkintertools==2.6.21.1
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Intelligent Magic Cube 🚀#

约 221 个字 2 行代码 预计阅读时间 2 分钟

A variety of intelligent search algorithms visually restore the 3D Magic Cube.

Note

This program is implemented by tkinter in combination with the third-party library tkintertools. tkintertools is a third-party library developed by me, I hope you will support me a lot!

Star History#

Star History Chart

How to use#

Before use#

Info

Make sure your Python version is 3.12 or greater.

Install dependency#

Install the third-party library tkintertools:

pip install tkintertools==2.6.21.1
 

or

pip install -r requirements.txt
 

One last step#

Run the main.py, and then, have fun! 😁

Brief introduction#

List of algorithms#

BFS DFS UCS A/A* HC REV
Breadth First Depth First Uniform Cost A / A Star Hill Climbing Not Algo, reverse operation

Evaluation functions#

CBSV ECLD MHT HM MKVSK h*
Chebyshev Euclid Manhattan Hamming Minkowski Ideal evaluation function

Customized actions#

L R U D F B
Left Right Up Down Front Back

Some operations#

  • Hold down the left mouse button and drag to rotate the Rubik’s Cube;
  • Hold down the right mouse button and drag to move the Rubik’s Cube;
  • Scroll the mouse wheel to zoom in and out of the Rubik’s Cube;

Warning

Some of the pictures and other resources involved in the project come from the Internet and are not used for commercial purposes.
Please contact me for infringement: 2951256653@qq.com


For illustrated tutorials, see: https://xiaokang2022.blog.csdn.net/article/details/136768000
For an introductory video, see: https://www.bilibili.com/video/BV1Gt421j7Sx/

\ No newline at end of file diff --git a/projects/index.html b/projects/index.html index 1f5b4368..cc527c5e 100755 --- a/projects/index.html +++ b/projects/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

Overview - 项目概览

约 244 个字 预计阅读时间 2 分钟

此处会给出一些用 tkintertools 开发的项目的实例。
Here are some examples of projects developed with tkintertools.

New Version Projects - 新版项目#

1. Intelligent Magic Cube - 智能魔方#

Watchers Forks Stars

png

2. Super Gobang - 五子棋#

  • Version - 版本: 2.0
  • Python - 环境: 3.12
  • OS - 操作系统: Windows
  • tkintertools: 2.6.21.1
  • url - 网址链接: ?
  • GitHub - 仓库: ?

png

Old Version Projects - 旧版项目#

Warning - 警告

这里都是使用旧版 tkintertools 编写的程序,最新版的 tkintertools 可能与之不兼容!
These are all programs written in the old version of tkintertools, and the latest version of tkintertools may not be compatible with it!

1. Chinese Chess - 中国象棋#

Watchers Forks Stars

png

2. Todo List - 任务清单#

png

3. Questioner#

  • Version - 版本: 0.0.7
  • Python - 环境: 3.10
  • OS - 操作系统: Windows
  • tkintertools: 2.5.11.3
  • url - 网址链接: ?
  • GitHub - 仓库: ?

png

欢迎在评论区留下你的想法

Overview - 项目概览

约 244 个字 预计阅读时间 2 分钟

此处会给出一些用 tkintertools 开发的项目的实例。
Here are some examples of projects developed with tkintertools.

New Version Projects - 新版项目#

1. Intelligent Magic Cube - 智能魔方#

Watchers Forks Stars

png

2. Super Gobang - 五子棋#

  • Version - 版本: 2.0
  • Python - 环境: 3.12
  • OS - 操作系统: Windows
  • tkintertools: 2.6.21.1
  • url - 网址链接: ?
  • GitHub - 仓库: ?

png

Old Version Projects - 旧版项目#

Warning - 警告

这里都是使用旧版 tkintertools 编写的程序,最新版的 tkintertools 可能与之不兼容!
These are all programs written in the old version of tkintertools, and the latest version of tkintertools may not be compatible with it!

1. Chinese Chess - 中国象棋#

Watchers Forks Stars

png

2. Todo List - 任务清单#

png

3. Questioner#

  • Version - 版本: 0.0.7
  • Python - 环境: 3.10
  • OS - 操作系统: Windows
  • tkintertools: 2.5.11.3
  • url - 网址链接: ?
  • GitHub - 仓库: ?

png

欢迎在评论区留下你的想法

前言#

约 360 个字 预计阅读时间 2 分钟

注意

目前此教程对应的环境如下:

  • tkintertools: 2.6.21
  • Python: 3.12.0
  • Windows: 23H2

一、本教程面向的群众#

主要面向想花费极少时间(包括学习时间和开发时间),开发较为美观的,方便的图形化程序。

感兴趣的话,任何人皆可,教程通俗易懂,(应该)没有看不懂的地方。

二、学习前置要求#

  • 必须要会 Python(不熟练也行),如果可以,掌握 Python 的内置模块 tkinter 会更好(不熟练也可);
  • 最好有面向对象的编程思想(没有也无妨);

三、推荐的开发 IDE#

Visual Studio Code > PyCharm > Visual Studio

顺便一提,我本人用的是 Visual Studio Code

四、作者之(鸟)语#

作者本人渣渣一个,目前非计算机专业大三在读,凝心血之力搞了这个二次开发的界面模块,纯属瞎搞,有兴趣的朋友可以看看源代码,帮我找找 bug,提提建议啥的。

这玩意儿我已经开发一年多了,学业繁忙(尽管我学的很渣),实际能抽出来更新的时间并不充裕。如果能有人加入我一起开发那就再好不过了!再不来个人帮忙开发,我就快死了,这玩意儿太 TM 肝了!!!

做这些,我不求任何回报(认真),只求大家觉得好用,方便就行!球球了,点个 Star 吧,哭……

欢迎在评论区留下你的想法

前言#

约 360 个字 预计阅读时间 2 分钟

注意

目前此教程对应的环境如下:

  • tkintertools: 2.6.21
  • Python: 3.12.0
  • Windows: 23H2

一、本教程面向的群众#

主要面向想花费极少时间(包括学习时间和开发时间),开发较为美观的,方便的图形化程序。

感兴趣的话,任何人皆可,教程通俗易懂,(应该)没有看不懂的地方。

二、学习前置要求#

  • 必须要会 Python(不熟练也行),如果可以,掌握 Python 的内置模块 tkinter 会更好(不熟练也可);
  • 最好有面向对象的编程思想(没有也无妨);

三、推荐的开发 IDE#

Visual Studio Code > PyCharm > Visual Studio

顺便一提,我本人用的是 Visual Studio Code

四、作者之(鸟)语#

作者本人渣渣一个,目前非计算机专业大三在读,凝心血之力搞了这个二次开发的界面模块,纯属瞎搞,有兴趣的朋友可以看看源代码,帮我找找 bug,提提建议啥的。

这玩意儿我已经开发一年多了,学业繁忙(尽管我学的很渣),实际能抽出来更新的时间并不充裕。如果能有人加入我一起开发那就再好不过了!再不来个人帮忙开发,我就快死了,这玩意儿太 TM 肝了!!!

做这些,我不求任何回报(认真),只求大家觉得好用,方便就行!球球了,点个 Star 吧,哭……

欢迎在评论区留下你的想法


下面没有更多评论啦😆

\ No newline at end of file +

下面没有更多评论啦😆

\ No newline at end of file diff --git a/tutorials/1-1/index.html b/tutorials/1-1/index.html index d7528187..0c37e26d 100755 --- a/tutorials/1-1/index.html +++ b/tutorials/1-1/index.html @@ -7,7 +7,7 @@ .gdesc-inner { font-size: 0.75rem; } body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);} body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);} - body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}

§1.1 安装 tkintertools#

约 1159 个字 5 行代码 预计阅读时间 8 分钟

一、运行环境#

tkintertools 是跨平台的,至少可以在下面多个平台上运行(已测试):

Windows10 Windows11 macOS macOS Ubuntu22.04 Deepin20.9

同时支持以下版本的 Python:

Python3.8 Python3.9 Python3.10 Python3.11 Python3.12 Python3.13

相关的依赖包(小部分 Python 没有自带,如 Linux 自带的 Python):

tkinter8.6.*

可提升性能和效果的相关第三方包(非必须安装):

Pillow

二、获取稳定版#

稳定版,相对于开发版本而言比较稳定,在发布之前有个测试的步骤,经过测试之后(各项功能正常运行,多平台兼容)才会发布,bug 大体上是没有那么多的,推荐使用这个。

2.1 Windows 平台#

稳定版可以通过 Python 的包下载工具 pip 来直接从 PyPI 上获取 tkintertools!以下命令默认安装最新稳定版 tkintertools

pip install tkintertools
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§1.1 安装 tkintertools#

约 1159 个字 5 行代码 预计阅读时间 8 分钟

一、运行环境#

tkintertools 是跨平台的,至少可以在下面多个平台上运行(已测试):

Windows10 Windows11 macOS macOS Ubuntu22.04 Deepin20.9

同时支持以下版本的 Python:

Python3.8 Python3.9 Python3.10 Python3.11 Python3.12 Python3.13

相关的依赖包(小部分 Python 没有自带,如 Linux 自带的 Python):

tkinter8.6.*

可提升性能和效果的相关第三方包(非必须安装):

Pillow

二、获取稳定版#

稳定版,相对于开发版本而言比较稳定,在发布之前有个测试的步骤,经过测试之后(各项功能正常运行,多平台兼容)才会发布,bug 大体上是没有那么多的,推荐使用这个。

2.1 Windows 平台#

稳定版可以通过 Python 的包下载工具 pip 来直接从 PyPI 上获取 tkintertools!以下命令默认安装最新稳定版 tkintertools

pip install tkintertools
 

若网速较慢,可选取镜像源来下载,但是镜像源可能不是最新的,下面是使用清华大学镜像源的方式进行安装:

pip install tkintertools -i https://pypi.tuna.tsinghua.edu.cn/simple/
 

2.2 macOS 平台#

同 Windows 平台,此处不再赘述。

2.3 Linux 平台#

由于 Linux 自带的 Python 环境可能不满足要求,因此在 Windows 平台操作的基础上还需添加一些额外的步骤。

2.3.1 检测是否有 tkinter#

打开终端输入 python3 进入 Linux 自带的 Python3 交互环境,输入下面的命令来验证 tkinter 是否安装:

import tkinter
 

若没有出现报错则说明已安装 tkinter,但是一般情况都是没有安装的,会报错。

2.3.2 通过 miniconda 安装合适的 Python 环境#

我们不直接安装 tkinter,因为直接安装 tkinter 的步骤非常繁琐且容易出错,这里推荐使用 Miniconda 来构建虚拟环境,不易出错且不影响 Linux 自带的 Python 环境。

注意

这里我们不使用 Anaconda 来搭建虚拟环境,Anaconda 因为附带很多我们用不到的功能导致非常庞大,而 Miniconda 只有其核心部分,占用存储空间比较小,操作起来也比较方便。

  1. 安装 Miniconda

这里给出官方安装操作:https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html

尽量选择较新版本的 Miniconda,这将决定 Miniconda 的 base 环境 Python 版本。

  1. 进入 base 环境并验证 tkinter 是否安装

一般来说,安装完 Miniconda 后终端将会进入 base 环境,此时输入 python 将会进入 base 中的 Python 环境,输入以下命令来确认 tkinter 是否安装:

import tkinter
diff --git a/tutorials/1-2/index.html b/tutorials/1-2/index.html
index d92a3617..688862f1 100755
--- a/tutorials/1-2/index.html
+++ b/tutorials/1-2/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§1.2 认识 tkintertools#

约 2279 个字 223 行代码 预计阅读时间 30 分钟

一、基本介绍#

tkintertools 是一款基于 tkinter 模块、二次开发的轻量级界面编程模块。它的设计初心是为了辅助 tkinter 进行界面的开发,以达到 美化界面快捷开发简单易用 的目的。

提示

想要充分地利用 tkintertools 模块,开发人员首先要对 tkinter 模块有一定的了解(不需要了解太多)!

1.1 基本原理#

tkintertools 的控件并非真实的控件,而是在 tkinter 模块中 Canvas 对象中绘制而成的,也就是说,所有的控件都是没有句柄的,都只是 Canvas 对象中的线条和颜色块罢了。但就是这些线条和颜色块,就能重新构建我们的控件,尽管它们并非真的控件。由于是绘制而成的,自然我们就可以自定义我们控件的外观,而不再被原始控件的外观所约束。这就是所谓的 “美化界面” 啦!

有了我们自己绘制的控件,当然还不够,还需要辅以一些工具类或者函数来帮助我们进行更加快捷的开发!比如能够快速形成动画的 Animation 类,不用我们自己管理控件缩放的重写的 Canvas 控件等等!这就是 “快捷开发”!

有了这些东西,要是小白程序员不会用,看不懂文档,那这个模块也是没有用的!因此我了解了很多 Python 关于 type hints(类型提示)的知识,直接把开发文档作为 docstring(文档字符串)放在了每个类和函数源代码对应的位置,程序员可以在 IDE 中将鼠标移到类或者函数的名字上,简明文档就会自动弹出来。简明文档里面包含了这个类或者函数的用法、参数名称及作用,还有重载说明。当然,为了兼容不同的 Python 版本,我使用的 type hints 是最朴素的方式,直接以注释的方式呈现。这就是设计初心中的 “简单易用” 了。关于 type hints,请看 PEP 484 - Type Hints

1.2 模块优点#

tkintertools 完全没有使用任何第三方模块和库,同时它也没有任何依赖包(除了 tkinter 本身),它的功能完全由内置模块和函数实现,而且它还是跨平台的!
它的控件是在 tkinter 模块中 Canvas 对象中绘制而成的,这就赋予了 tkintertools 控件一些在 tkinter 中没有的特性,列举如下:

  • 控件背景可以是透明的(实际上就是没有填充颜色);
  • 控件的样式是高度自定义的(比如按钮有圆角);
  • 模块十分轻量,模块本身不包含任何资源文件,只有代码,且没有任何第三方模块的依赖,且只有仅仅一百多 KB,不像那些大型的库,动不动就几十 MB;

1.3 模块缺点#

模块使用了原生的 Canvas 对象作为底层基础,必然就牺牲了一些特性,同时还产生了一些缺点:

  • 虚拟的控件无法获取焦点(Tab 键切换的那个焦点);
  • 虚拟的控件在文本输入和显示的功能上存在一些缺陷,文本可能会显示在边框外面;

二、特色功能#

下面列举一些 tkintertools 模块还具有的一些特色功能(不一定完整)。

2.1 高度可配置的控件#

tkintertools 模块的控件拥有许多参数供我们设置,比如圆角的半径、文本和边框以及控件内部的颜色,关联事件等等。
这里要说明的是,每个控件可以设置的关联事件不止一种,在鼠标经过控件时可以绑定事件,鼠标点击控件也可以,鼠标点击后松开也行等等。
文本和边框以及控件的填充色也是类似的,在鼠标经过控件、点击控件、点击后松开都可以设定颜色。
文本类控件还能够从右边逐步输入文本,文本输入提示符也可以不是单调无趣的竖线,可以是其他的,比如下划线等。

下面给大家简单展示几张图,让大家感受一下效果!

png

倒数第五排的控件有个透明的效果,上图展示不出来,这里加上背景图片会更清晰一点:

png

下面是源代码,上图中左下按钮点击后可以打开模块源代码的仓库,倒数第二排的开关可以切换背景。

不接受反驳,我觉得这比 tkinter 原生的控件好看了 100 倍!

源代码
import webbrowser
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§1.2 认识 tkintertools#

约 2279 个字 223 行代码 预计阅读时间 30 分钟

一、基本介绍#

tkintertools 是一款基于 tkinter 模块、二次开发的轻量级界面编程模块。它的设计初心是为了辅助 tkinter 进行界面的开发,以达到 美化界面快捷开发简单易用 的目的。

提示

想要充分地利用 tkintertools 模块,开发人员首先要对 tkinter 模块有一定的了解(不需要了解太多)!

1.1 基本原理#

tkintertools 的控件并非真实的控件,而是在 tkinter 模块中 Canvas 对象中绘制而成的,也就是说,所有的控件都是没有句柄的,都只是 Canvas 对象中的线条和颜色块罢了。但就是这些线条和颜色块,就能重新构建我们的控件,尽管它们并非真的控件。由于是绘制而成的,自然我们就可以自定义我们控件的外观,而不再被原始控件的外观所约束。这就是所谓的 “美化界面” 啦!

有了我们自己绘制的控件,当然还不够,还需要辅以一些工具类或者函数来帮助我们进行更加快捷的开发!比如能够快速形成动画的 Animation 类,不用我们自己管理控件缩放的重写的 Canvas 控件等等!这就是 “快捷开发”!

有了这些东西,要是小白程序员不会用,看不懂文档,那这个模块也是没有用的!因此我了解了很多 Python 关于 type hints(类型提示)的知识,直接把开发文档作为 docstring(文档字符串)放在了每个类和函数源代码对应的位置,程序员可以在 IDE 中将鼠标移到类或者函数的名字上,简明文档就会自动弹出来。简明文档里面包含了这个类或者函数的用法、参数名称及作用,还有重载说明。当然,为了兼容不同的 Python 版本,我使用的 type hints 是最朴素的方式,直接以注释的方式呈现。这就是设计初心中的 “简单易用” 了。关于 type hints,请看 PEP 484 - Type Hints

1.2 模块优点#

tkintertools 完全没有使用任何第三方模块和库,同时它也没有任何依赖包(除了 tkinter 本身),它的功能完全由内置模块和函数实现,而且它还是跨平台的!
它的控件是在 tkinter 模块中 Canvas 对象中绘制而成的,这就赋予了 tkintertools 控件一些在 tkinter 中没有的特性,列举如下:

  • 控件背景可以是透明的(实际上就是没有填充颜色);
  • 控件的样式是高度自定义的(比如按钮有圆角);
  • 模块十分轻量,模块本身不包含任何资源文件,只有代码,且没有任何第三方模块的依赖,且只有仅仅一百多 KB,不像那些大型的库,动不动就几十 MB;

1.3 模块缺点#

模块使用了原生的 Canvas 对象作为底层基础,必然就牺牲了一些特性,同时还产生了一些缺点:

  • 虚拟的控件无法获取焦点(Tab 键切换的那个焦点);
  • 虚拟的控件在文本输入和显示的功能上存在一些缺陷,文本可能会显示在边框外面;

二、特色功能#

下面列举一些 tkintertools 模块还具有的一些特色功能(不一定完整)。

2.1 高度可配置的控件#

tkintertools 模块的控件拥有许多参数供我们设置,比如圆角的半径、文本和边框以及控件内部的颜色,关联事件等等。
这里要说明的是,每个控件可以设置的关联事件不止一种,在鼠标经过控件时可以绑定事件,鼠标点击控件也可以,鼠标点击后松开也行等等。
文本和边框以及控件的填充色也是类似的,在鼠标经过控件、点击控件、点击后松开都可以设定颜色。
文本类控件还能够从右边逐步输入文本,文本输入提示符也可以不是单调无趣的竖线,可以是其他的,比如下划线等。

下面给大家简单展示几张图,让大家感受一下效果!

png

倒数第五排的控件有个透明的效果,上图展示不出来,这里加上背景图片会更清晰一点:

png

下面是源代码,上图中左下按钮点击后可以打开模块源代码的仓库,倒数第二排的开关可以切换背景。

不接受反驳,我觉得这比 tkinter 原生的控件好看了 100 倍!

源代码
import webbrowser
 
 import tkintertools as tkt
 
diff --git a/tutorials/1-3/index.html b/tutorials/1-3/index.html
index 5a4c7af3..180be89e 100755
--- a/tutorials/1-3/index.html
+++ b/tutorials/1-3/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§1.3 tkintertools 初体验#

约 1337 个字 66 行代码 预计阅读时间 13 分钟

提示

若你没有任何前置知识,可以跳过可选部分,只需你跟着后面的教程一步一步来,体验一下利用 tkintertools 开发图形化程序即可。

对于了解 tkinter 的人,可以看一下可选部分,能够加深对 tkintertools 框架的理解。

一、基本框架(可选)#

1.1 tkinter 界面程序的开发框架#

tkinter 开发了解的开发人员会知道,tkinter 的开发框架一般是下面这样的:

  1. 引入模块;
  2. 创建根窗口;
  3. 建立界面和程序逻辑;
  4. 根窗口进入消息事件循环;

其中 1、2 和 4 是必须的,其所有的控件都以最顶级的容器控件 —— 根窗口,为基础。
也就是说,所有的控件都必须以它为父控件。

下面是一段示例:

import tkinter as tk  # 引入模块
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§1.3 tkintertools 初体验#

约 1337 个字 66 行代码 预计阅读时间 13 分钟

提示

若你没有任何前置知识,可以跳过可选部分,只需你跟着后面的教程一步一步来,体验一下利用 tkintertools 开发图形化程序即可。

对于了解 tkinter 的人,可以看一下可选部分,能够加深对 tkintertools 框架的理解。

一、基本框架(可选)#

1.1 tkinter 界面程序的开发框架#

tkinter 开发了解的开发人员会知道,tkinter 的开发框架一般是下面这样的:

  1. 引入模块;
  2. 创建根窗口;
  3. 建立界面和程序逻辑;
  4. 根窗口进入消息事件循环;

其中 1、2 和 4 是必须的,其所有的控件都以最顶级的容器控件 —— 根窗口,为基础。
也就是说,所有的控件都必须以它为父控件。

下面是一段示例:

import tkinter as tk  # 引入模块
 
 root = tk.Tk()  # 创建根窗口
 
diff --git a/tutorials/2-1/index.html b/tutorials/2-1/index.html
index 945dae87..0013f8d6 100755
--- a/tutorials/2-1/index.html
+++ b/tutorials/2-1/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}     

第二章:容器控件

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第二章:容器控件

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第三章:功能控件

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第三章:功能控件

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第四章:界面布局

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第四章:界面布局

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

§5.1 静态图片#

约 850 个字 33 行代码 预计阅读时间 8 分钟

一、png 图片#

tkintertoolsPhotoImage 是继承自 tkinterPhotoImage 类的,因此 tkinter.PhotoImage 的功能基本上都是可以使用的,为什么是基本上呢?因为有一些方法被重载了。后面会详细讲到。

1.1 支持的图片文件#

目前支持的图片类型仍然和 tkinter.PhotoImage 保持一致,一般是指 png 和 gif。虽然是这样,但是 tkintertools.PhotoImage 仍然提供了更多的功能。

1.2 图片缩放#

以前我们在编写 tkinter 时常常会配合 PIL 库一起使用,因为 tkinter.PhotoImage 无法缩放图片,但是事实并非如此。tkinter.PhotoImage 实际上也是可以进行缩放的,只不过自带的方法只能进行整数倍缩放。放大是方法 PhotoImage.zoom,缩小是 PhotoImage.subsample。无法进行特殊倍数的缩放属实可惜了。

tkintertools 则很好地解决了这个问题,我们可以将 tkintertools.PhotoImage 缩放为任意大小,不过这个过程比较消耗计算机性能,当然,tkintertools 也会尝试调用 PIL 库来提高性能,前提是你得有 PIL 库。如果你没有 PILtkintertools 也是可以正常缩放图片的,只不过性能上就不好说了。

注意

图片缩放只适用于 png 类型的图片。

tkintertools.PhotoImage 使用方法 zoom 来缩放图片,可以放大和缩小,参数是宽高的缩放比例,返回一个新的 tkinter.PhotoImage 对象。一般来说我们不需要主动去调用这个方法,因为 tkintertools 底层会自动调用这个方法来让图片自动缩放以适应窗口(画布)的宽高。关于自动缩放这一点,可以见 §1.2 认识 tkintertools 自动控制大小部分。

下面是一个简单的例子:

import tkintertools as tkt
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§5.1 静态图片#

约 850 个字 33 行代码 预计阅读时间 8 分钟

一、png 图片#

tkintertoolsPhotoImage 是继承自 tkinterPhotoImage 类的,因此 tkinter.PhotoImage 的功能基本上都是可以使用的,为什么是基本上呢?因为有一些方法被重载了。后面会详细讲到。

1.1 支持的图片文件#

目前支持的图片类型仍然和 tkinter.PhotoImage 保持一致,一般是指 png 和 gif。虽然是这样,但是 tkintertools.PhotoImage 仍然提供了更多的功能。

1.2 图片缩放#

以前我们在编写 tkinter 时常常会配合 PIL 库一起使用,因为 tkinter.PhotoImage 无法缩放图片,但是事实并非如此。tkinter.PhotoImage 实际上也是可以进行缩放的,只不过自带的方法只能进行整数倍缩放。放大是方法 PhotoImage.zoom,缩小是 PhotoImage.subsample。无法进行特殊倍数的缩放属实可惜了。

tkintertools 则很好地解决了这个问题,我们可以将 tkintertools.PhotoImage 缩放为任意大小,不过这个过程比较消耗计算机性能,当然,tkintertools 也会尝试调用 PIL 库来提高性能,前提是你得有 PIL 库。如果你没有 PILtkintertools 也是可以正常缩放图片的,只不过性能上就不好说了。

注意

图片缩放只适用于 png 类型的图片。

tkintertools.PhotoImage 使用方法 zoom 来缩放图片,可以放大和缩小,参数是宽高的缩放比例,返回一个新的 tkinter.PhotoImage 对象。一般来说我们不需要主动去调用这个方法,因为 tkintertools 底层会自动调用这个方法来让图片自动缩放以适应窗口(画布)的宽高。关于自动缩放这一点,可以见 §1.2 认识 tkintertools 自动控制大小部分。

下面是一个简单的例子:

import tkintertools as tkt
 
 root = tkt.Tk('图片缩放', 1600, 900)
 canvas = tkt.Canvas(root, 1600, 900, 0, 0, bg='orange')  # 背景色改为橙色,方便区分
diff --git a/tutorials/5-2/index.html b/tutorials/5-2/index.html
index e2723f14..0064b0ea 100755
--- a/tutorials/5-2/index.html
+++ b/tutorials/5-2/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§5.2 动态图片#

约 948 个字 29 行代码 预计阅读时间 8 分钟

一、解析 gif 的方式#

解析 gif 实际就是得到 gif 文件的每一帧信息并存储起来,根据不同的需求,tkintertools.PhotoImage 提供了两种解析 gif 的方式,分别是运行前解析和运行时解析。从名字上不难知道是什么意思。

1.1 运行前解析#

运行前解析会在 gif 图片进行展示之前就对其解析,这个过程会阻塞整个线程,当图片的总帧数很少的时候,影响不大,感觉不出来,但当文件的总帧数非常大,这种延迟就很明显,甚至导致窗口卡死或者无响应,如果在窗口出现之前就开始解析,那么窗口会一直等到解析完毕后再弹出,非常影响用户体验。

1.2 运行时解析#

运行时解析会在其他事件运行的同时同步地解析 gif 图片,解析的时候,整个窗口会略微卡顿,但启动速度会非常快。当然,这种解析只会持续一遍,当解析完成后,窗口就和运行前解析一样,不会有任何的卡顿。

1.3 解析方式的选取#

两种解析方式各有特点,按需选取合适的解析方式。一般来说,大文件一定要用运行时解析,不然阻塞时间会让你怀疑人生的……当然你也可以偷懒,全部用运行时解析,为什么可以偷懒呢?因为不用写解析部分的代码(别看我,我就是这么干的)。

二、运行前解析 gif#

我们通过 PhotoImage.parse 得到解析生成器,此生成器每次返回一个 int 类型的数据,以表示当前解析的帧数。我们需要遍历这个生成器来完成解析过程。以下是示例代码:

import tkintertools as tkt
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§5.2 动态图片#

约 948 个字 29 行代码 预计阅读时间 8 分钟

一、解析 gif 的方式#

解析 gif 实际就是得到 gif 文件的每一帧信息并存储起来,根据不同的需求,tkintertools.PhotoImage 提供了两种解析 gif 的方式,分别是运行前解析和运行时解析。从名字上不难知道是什么意思。

1.1 运行前解析#

运行前解析会在 gif 图片进行展示之前就对其解析,这个过程会阻塞整个线程,当图片的总帧数很少的时候,影响不大,感觉不出来,但当文件的总帧数非常大,这种延迟就很明显,甚至导致窗口卡死或者无响应,如果在窗口出现之前就开始解析,那么窗口会一直等到解析完毕后再弹出,非常影响用户体验。

1.2 运行时解析#

运行时解析会在其他事件运行的同时同步地解析 gif 图片,解析的时候,整个窗口会略微卡顿,但启动速度会非常快。当然,这种解析只会持续一遍,当解析完成后,窗口就和运行前解析一样,不会有任何的卡顿。

1.3 解析方式的选取#

两种解析方式各有特点,按需选取合适的解析方式。一般来说,大文件一定要用运行时解析,不然阻塞时间会让你怀疑人生的……当然你也可以偷懒,全部用运行时解析,为什么可以偷懒呢?因为不用写解析部分的代码(别看我,我就是这么干的)。

二、运行前解析 gif#

我们通过 PhotoImage.parse 得到解析生成器,此生成器每次返回一个 int 类型的数据,以表示当前解析的帧数。我们需要遍历这个生成器来完成解析过程。以下是示例代码:

import tkintertools as tkt
 
 root = tkt.Tk('运行前解析', 1280, 720)
 canvas = tkt.Canvas(root, 1280, 720, 0, 0)
diff --git a/tutorials/5-3/index.html b/tutorials/5-3/index.html
index 98b2249b..16a247e5 100755
--- a/tutorials/5-3/index.html
+++ b/tutorials/5-3/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§5.3 图片进阶#

约 823 个字 39 行代码 预计阅读时间 8 分钟

这一小节不讲别的,就讲进度条和 gif 解析的联动。

注意

此小节会涉及到一些与多线程相关的知识。

一、获取 gif 图片的总帧数#

要想知道 gif 解析了多少,必须得先知道 gif 的总帧数。你可以通过其他的软件来获取 gif 图的总帧数,你也可也通过下面的代码来获取 gif 的总帧数。

PhotoImageget_total_frames 可以获取 gif 的总帧数(并非 FPS):

image = tkt.PhotoImage('example.gif')
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§5.3 图片进阶#

约 823 个字 39 行代码 预计阅读时间 8 分钟

这一小节不讲别的,就讲进度条和 gif 解析的联动。

注意

此小节会涉及到一些与多线程相关的知识。

一、获取 gif 图片的总帧数#

要想知道 gif 解析了多少,必须得先知道 gif 的总帧数。你可以通过其他的软件来获取 gif 图的总帧数,你也可也通过下面的代码来获取 gif 的总帧数。

PhotoImageget_total_frames 可以获取 gif 的总帧数(并非 FPS):

image = tkt.PhotoImage('example.gif')
 
 print(image.get_total_frames())
 

提示

当 gif 的总帧数比较大的时候,上面代码还是比较慢的,此时如果你有 PIL 库,这一过程将会加快几倍。当然,如果你没有 PIL 库,上面的代码依然可以获得 gif 的总帧数,只不过慢一些罢了。

通常我们并不会在正式程序中直接使用上述方法来获取 gif 的总帧数,我们应该在正式程序之前,就通过测试得到 gif 的帧数,然后作为常量写在程序中。因为获取 gif 总帧数并不是一个很快的过程,如果直接在正式程序中调用,卡顿的现象将十分明显。

二、以进度条展示加载进度#

2.1 运行前解析的进度条展示#

由于 gif 的解析是一个阻塞过程,所以这里我们要采用多线程来避免程序的严重卡顿。

import threading
diff --git a/tutorials/6-1/index.html b/tutorials/6-1/index.html
index 25a5e5d6..e76175d8 100755
--- a/tutorials/6-1/index.html
+++ b/tutorials/6-1/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§6.1 颜色效果#

约 1540 个字 46 行代码 预计阅读时间 13 分钟

一、自定义控件的颜色#

1.1 颜色字符串#

我们一般用颜色字符串来表示一个颜色,格式有两种。

其一,就是简单粗暴的颜色英文名称,如 "red""green""blue" 等,但并不是所有的颜色都可以被识别,主要是指 CSS 中所用的颜色字符串。这种方式比较简单明了,可以很清楚这种颜色的效果,但是并不够精细,如果想要精确地展示某一颜色,必须要用到 RGB 颜色码。

RGB 颜色码就是第二种格式。R 表示 Red,意为红色程度,G 表示 Green,意为绿色程度,B 表示 Blue,意为蓝色程度。它们的程度都用 16 进制的数字来表示,位数一般为 1~4 皆可,常用的是 1 位和 2 位的。比如 "#FFF" 表示 1 位的,"#000000" 表示 2 位的。这些颜色字符串前面都加了一个符号 “#” 来表示它是一个 RGB 格式的颜色码。关于颜色程度,0 为最小,F 为最大,0~F 依次增大。

扩展:为什么用红绿蓝表示颜色?

这是因为电子屏幕基本上都是用红色、绿色和蓝色来显示颜色的,当他们的占比不同,显示的颜色就不同。不信你可以拿放大镜仔细看电子屏幕,你会发现它们实际都是红色、绿色和蓝色,并没有其他的颜色。

1.2 透明#

由于 tkintertools 所使用最主要的容器控件是 Canvas,而 Canvas 的颜色机制与其他控件略有不同。要说具体区别,那就是如果颜色为空,则在 Canvas 中表现为不绘制对应的颜色块(体现为完全透明),而不是报错。

透明对应到颜色字符串上,就是一个空字符串 —— ""(注意:不是空格字符串,是空字符串)。

1.3 自定义控件的颜色#

在讲解给控件自定义颜色之前,我们有必要知道,一个控件的一般组成。一个控件,一般由三个部分组成:外框、内块和文本。当然,这是一般的控件,更加复杂的控件或者非常简单的控件可能并不是这个样子。

tkintertools 的控件一般在实例化的时候会给定几个颜色参数,一般分别是:

  • color_fill: 内块的颜色元组
  • color_outline: 外框的颜色元组
  • color_text: 文本的颜色元组

有部分控件可能并没有完整的上述三个参数,比如 Switch 就没有 color_text,因为它根本就没有文本部分。

我们可以注意到,上述参数的值都是颜色元组,并非颜色字符串,实际上,这里的颜色元组属于 tkintertools 制定的一种格式,一般是这样的:

(控件正常时的颜色, 控件被触碰时的颜色, 控件交互时的颜色, 控件被禁用时的颜色)
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§6.1 颜色效果#

约 1540 个字 46 行代码 预计阅读时间 13 分钟

一、自定义控件的颜色#

1.1 颜色字符串#

我们一般用颜色字符串来表示一个颜色,格式有两种。

其一,就是简单粗暴的颜色英文名称,如 "red""green""blue" 等,但并不是所有的颜色都可以被识别,主要是指 CSS 中所用的颜色字符串。这种方式比较简单明了,可以很清楚这种颜色的效果,但是并不够精细,如果想要精确地展示某一颜色,必须要用到 RGB 颜色码。

RGB 颜色码就是第二种格式。R 表示 Red,意为红色程度,G 表示 Green,意为绿色程度,B 表示 Blue,意为蓝色程度。它们的程度都用 16 进制的数字来表示,位数一般为 1~4 皆可,常用的是 1 位和 2 位的。比如 "#FFF" 表示 1 位的,"#000000" 表示 2 位的。这些颜色字符串前面都加了一个符号 “#” 来表示它是一个 RGB 格式的颜色码。关于颜色程度,0 为最小,F 为最大,0~F 依次增大。

扩展:为什么用红绿蓝表示颜色?

这是因为电子屏幕基本上都是用红色、绿色和蓝色来显示颜色的,当他们的占比不同,显示的颜色就不同。不信你可以拿放大镜仔细看电子屏幕,你会发现它们实际都是红色、绿色和蓝色,并没有其他的颜色。

1.2 透明#

由于 tkintertools 所使用最主要的容器控件是 Canvas,而 Canvas 的颜色机制与其他控件略有不同。要说具体区别,那就是如果颜色为空,则在 Canvas 中表现为不绘制对应的颜色块(体现为完全透明),而不是报错。

透明对应到颜色字符串上,就是一个空字符串 —— ""(注意:不是空格字符串,是空字符串)。

1.3 自定义控件的颜色#

在讲解给控件自定义颜色之前,我们有必要知道,一个控件的一般组成。一个控件,一般由三个部分组成:外框、内块和文本。当然,这是一般的控件,更加复杂的控件或者非常简单的控件可能并不是这个样子。

tkintertools 的控件一般在实例化的时候会给定几个颜色参数,一般分别是:

  • color_fill: 内块的颜色元组
  • color_outline: 外框的颜色元组
  • color_text: 文本的颜色元组

有部分控件可能并没有完整的上述三个参数,比如 Switch 就没有 color_text,因为它根本就没有文本部分。

我们可以注意到,上述参数的值都是颜色元组,并非颜色字符串,实际上,这里的颜色元组属于 tkintertools 制定的一种格式,一般是这样的:

(控件正常时的颜色, 控件被触碰时的颜色, 控件交互时的颜色, 控件被禁用时的颜色)
 
  • 控件正常时的颜色: 一般情况下的颜色
  • 控件被触碰时的颜色: 鼠标悬停于控件上时的颜色
  • 控件交互时的颜色: 控件被点击等事件被触发时的颜色
  • 控件被禁用时的颜色: 控件被禁用后显示的颜色

只能多,不能少,不然在调用相关的方法时会报错导致对应功能无法执行(但不会引起整个程序崩溃)。当然也并不一定是元组,只要是一个对应格式的序列即可,比如列表等。

现在你应该知道 §1.2 认识 tkintertools 中第 1 张和第 2 张图中大部分控件是怎么做出来的吧?源代码在图片下面,去看看吧!

二、创建颜色丰富的控件或画面#

tkintertools 的颜色处理是完全交给函数 color 的。tkintertools.color 非常强大,能快速获得大量渐变色、对比色等。

2.1 获取对比色#

我们通过 color 函数获取一个颜色的对比色。下面是一个简单示例:

print(tkt.color("red"))  # "#00FFFF"
 

tkintertools.color 只有一个参数的时候,将返回该参数的对比色。

2.2 获取渐变色#

实际获取渐变色并非 tkintertools.color 的主要功能,函数 color 有几个参数,可见 函数 color 的文档。不难知道,color 的主要功能是得到一个颜色字符串按比例到目标颜色字符串的结果。当这个比例为 1 的时候,返回值就是目标颜色字符串,而目标颜色字符串的默认值是对比色,默认比例也是 1,因此当没有其他参数的时候,返回值就是对比色(见上面 2.1 获取对比色)。

当这个比例是慢慢变化的,我们就可以得到渐变色的效果了。当然,我们不应该通过循环来获取每一个比例的颜色,毕竟颜色字符串转换成 RGB 颜色码是需要花费一定时间的,如果直接手动循环得到渐变色,那么将十分消耗性能,我们应该通过参数 seqlength 来得到一系列渐变色。下面是一个简单的示例:

import tkintertools as tkt
 
diff --git a/tutorials/6-2/index.html b/tutorials/6-2/index.html
index 389ccf1a..6c2a5610 100755
--- a/tutorials/6-2/index.html
+++ b/tutorials/6-2/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§6.2 动画制作#

约 946 个字 79 行代码 预计阅读时间 12 分钟

tkintertools 中的大部分动画都是用动画类 Animation 实现的。Animation 的文档见 01. Animation

一、简单动画#

1.1 移动一个简单的方块#

我们可以通过 Animation 来平移一个简单的方块,下面是一个简单的示例:

import tkintertools as tkt
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§6.2 动画制作#

约 946 个字 79 行代码 预计阅读时间 12 分钟

tkintertools 中的大部分动画都是用动画类 Animation 实现的。Animation 的文档见 01. Animation

一、简单动画#

1.1 移动一个简单的方块#

我们可以通过 Animation 来平移一个简单的方块,下面是一个简单的示例:

import tkintertools as tkt
 
 root = tkt.Tk("平移方块", 1600, 900)
 canvas = tkt.Canvas(root, 1600, 900, 0, 0)
diff --git a/tutorials/7-1/index.html b/tutorials/7-1/index.html
index bc495e5f..efdf8d60 100755
--- a/tutorials/7-1/index.html
+++ b/tutorials/7-1/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.1 3D 对象#

约 1925 个字 181 行代码 预计阅读时间 25 分钟

一、3D 对象的容器控件#

tkintertools 的 3D 画布不是只有一个,它实际的继承关系是下面这样的:

flowchart RL
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.1 3D 对象#

约 1925 个字 181 行代码 预计阅读时间 25 分钟

一、3D 对象的容器控件#

tkintertools 的 3D 画布不是只有一个,它实际的继承关系是下面这样的:

flowchart RL
     id1(tkinter.Canvas)
     id2(tkintertools.Canvas)
     id3(tools_3d.Canvas3D)
diff --git a/tutorials/7-2/index.html b/tutorials/7-2/index.html
index c0d0d695..65342321 100755
--- a/tutorials/7-2/index.html
+++ b/tutorials/7-2/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.2 3D 文本#

约 287 个字 46 行代码 预计阅读时间 5 分钟

一、标记文本#

标记文本并不算是真正的 3D 的文本,它只是在画布上某一位置进行标记,其大小并不会随着标记点位置的改变而改变。

标记文本,顾名思义,只是为了标记而已。实际上,上一章开头的那张图中的文本就是标记文本。

标记文本是类 tools_3d.Point 的一个参数,下面会进行简单的演示:

png

上图就是很简单地给一个正方体的 8 个顶点标记了字母。看到这里,或许你可以思考一下,如何实现上一章开头的那张图的效果。

源代码
import tkintertools as tkt
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.2 3D 文本#

约 287 个字 46 行代码 预计阅读时间 5 分钟

一、标记文本#

标记文本并不算是真正的 3D 的文本,它只是在画布上某一位置进行标记,其大小并不会随着标记点位置的改变而改变。

标记文本,顾名思义,只是为了标记而已。实际上,上一章开头的那张图中的文本就是标记文本。

标记文本是类 tools_3d.Point 的一个参数,下面会进行简单的演示:

png

上图就是很简单地给一个正方体的 8 个顶点标记了字母。看到这里,或许你可以思考一下,如何实现上一章开头的那张图的效果。

源代码
import tkintertools as tkt
 from tkintertools import tools_3d as t3d
 
 root = tkt.Tk('Markup Text', 1280, 720)
diff --git a/tutorials/7-3/index.html b/tutorials/7-3/index.html
index 8af14228..45fb8237 100755
--- a/tutorials/7-3/index.html
+++ b/tutorials/7-3/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.3 3D 动画#

约 720 个字 126 行代码 预计阅读时间 13 分钟

一、3D 对象 API#

3D 对象有许许多多方法供我们调用。

1.1 基本 3D 对象的 API#

基本 3D 对象的 API 名称都是一样的,它们都是继承自类 _Object3D,都可以进行平移、旋转和缩放。

1.1.1 平移#

平移使用方法 translate,平移没有什么特别,就是移动对象在空间中的位置。

1.1.2 旋转#

旋转使用方法 rotate,旋转有两个重载,可以旋转绕某一点进行旋转,也可以旋转绕某一条线进行旋转。 两者的参数略有不同,默认情况下是绕原点进行旋转。

1.1.3 缩放#

缩放使用方法 scale,缩放没有重载,但是它有一个参数非常有意思,即缩放参照点。将这个点设为原点,那么对象将会以原点为参照进行大小缩放,这样它的大小和位置都会发生改变。但如果我们将其设为改对象的几何中心,则对象只有大小会发生变化,位置不会有改动。

1.1.4 几何中心#

此 API 名为 center,调用它不会有任何变化,但它返回该对象的几何中心。可以配合其他 API 来进行使用。

1.2 复杂 3D 对象的 API#

其实复杂的 3D 对象本质上就是基本 3D 对象的组合体而已,因此它们在拥有基本 3D 对象的 API 的前提下,还有其他的方法。内置的两种复杂几何体都是继承于类 Geometry,它们本身没有额外的方法,但是 Geometry 相比于基本 3D 对象,增加了一个 append 方法,可以将更多的基本 3D 对象添加到一个几何体实例中去。

二、通过动画类实现 3D 动画#

动画类指的就是上一章的 Animation,通过它我们可以很方便地实现一些简单乃至复杂的动画。

有了 3D 对象的 API 之后,我们就可以通过动画类来实现各种各样~花里胡哨~的效果!Animation 的使用方法已在上一章讲述,这里不再赘述。

三、通过 after 方法实现简单动画#

除了可以使用 Animation 类之外,我们还可以使用 tkinter 模块中的功能来实现一些简单的功能。

tkinter 模块中的控件都有一个名为 after 的方法,可以让我们快速做出比较简单的动画,实际上,Animation 的底层也是调用的 after,只不过进行了一些简单的封装。

下面是一个简单的示例(如果下面的动图很卡,说明你网页加载比较慢,并非 tkintertools 的问题,耐心等待就好):

gif

是不是眼花缭乱了?

源代码
import math
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.3 3D 动画#

约 720 个字 126 行代码 预计阅读时间 13 分钟

一、3D 对象 API#

3D 对象有许许多多方法供我们调用。

1.1 基本 3D 对象的 API#

基本 3D 对象的 API 名称都是一样的,它们都是继承自类 _Object3D,都可以进行平移、旋转和缩放。

1.1.1 平移#

平移使用方法 translate,平移没有什么特别,就是移动对象在空间中的位置。

1.1.2 旋转#

旋转使用方法 rotate,旋转有两个重载,可以旋转绕某一点进行旋转,也可以旋转绕某一条线进行旋转。 两者的参数略有不同,默认情况下是绕原点进行旋转。

1.1.3 缩放#

缩放使用方法 scale,缩放没有重载,但是它有一个参数非常有意思,即缩放参照点。将这个点设为原点,那么对象将会以原点为参照进行大小缩放,这样它的大小和位置都会发生改变。但如果我们将其设为改对象的几何中心,则对象只有大小会发生变化,位置不会有改动。

1.1.4 几何中心#

此 API 名为 center,调用它不会有任何变化,但它返回该对象的几何中心。可以配合其他 API 来进行使用。

1.2 复杂 3D 对象的 API#

其实复杂的 3D 对象本质上就是基本 3D 对象的组合体而已,因此它们在拥有基本 3D 对象的 API 的前提下,还有其他的方法。内置的两种复杂几何体都是继承于类 Geometry,它们本身没有额外的方法,但是 Geometry 相比于基本 3D 对象,增加了一个 append 方法,可以将更多的基本 3D 对象添加到一个几何体实例中去。

二、通过动画类实现 3D 动画#

动画类指的就是上一章的 Animation,通过它我们可以很方便地实现一些简单乃至复杂的动画。

有了 3D 对象的 API 之后,我们就可以通过动画类来实现各种各样~花里胡哨~的效果!Animation 的使用方法已在上一章讲述,这里不再赘述。

三、通过 after 方法实现简单动画#

除了可以使用 Animation 类之外,我们还可以使用 tkinter 模块中的功能来实现一些简单的功能。

tkinter 模块中的控件都有一个名为 after 的方法,可以让我们快速做出比较简单的动画,实际上,Animation 的底层也是调用的 after,只不过进行了一些简单的封装。

下面是一个简单的示例(如果下面的动图很卡,说明你网页加载比较慢,并非 tkintertools 的问题,耐心等待就好):

gif

是不是眼花缭乱了?

源代码
import math
 
 import tkintertools as tkt
 from tkintertools import tools_3d as t3d
diff --git a/tutorials/7-4/index.html b/tutorials/7-4/index.html
index b11c67e7..eb256186 100755
--- a/tutorials/7-4/index.html
+++ b/tutorials/7-4/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.4 3D 进阶#

约 497 个字 28 行代码 预计阅读时间 5 分钟

一、自定义 3D 画布#

1.1 绑定事件#

每个 3D 对象都有三个基本的功能,分别为平移(translate)、旋转(rotate)和缩放(scale),使用者可以根据自身需要,自定义绑定事件并调用相关的方法。比如说,我们现在想做这样一个绑定:按下等号键和减号键可以使每个 3D 对象自身的大小进行缩放,那么就可以按下面的步骤做。

分析:使 3D 对象自身大小进行缩放需要调用方法 scale,且缩放中心就是每个 3D 对象自身的几何中心,参数 center 值为 None,也就是默认值的时候,它会按自身的几何中心进行缩放。这里可以使用 Canvas3D 作为容器控件,也可以使用 Space,这并不会影响到这个功能的实现。

png

源代码
import tkintertools as tkt
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

§7.4 3D 进阶#

约 497 个字 28 行代码 预计阅读时间 5 分钟

一、自定义 3D 画布#

1.1 绑定事件#

每个 3D 对象都有三个基本的功能,分别为平移(translate)、旋转(rotate)和缩放(scale),使用者可以根据自身需要,自定义绑定事件并调用相关的方法。比如说,我们现在想做这样一个绑定:按下等号键和减号键可以使每个 3D 对象自身的大小进行缩放,那么就可以按下面的步骤做。

分析:使 3D 对象自身大小进行缩放需要调用方法 scale,且缩放中心就是每个 3D 对象自身的几何中心,参数 center 值为 None,也就是默认值的时候,它会按自身的几何中心进行缩放。这里可以使用 Canvas3D 作为容器控件,也可以使用 Space,这并不会影响到这个功能的实现。

png

源代码
import tkintertools as tkt
 from tkintertools import tools_3d as t3d
 
 root = tkt.Tk('Bind Event', 1280, 720)
diff --git a/tutorials/8-1/index.html b/tutorials/8-1/index.html
index a731894e..01b6416e 100755
--- a/tutorials/8-1/index.html
+++ b/tutorials/8-1/index.html
@@ -7,7 +7,7 @@
     .gdesc-inner { font-size: 0.75rem; }
     body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
     body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
-    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}     

第八章:杂项

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第八章:杂项

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第九章:实战

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法

第九章:实战

约 19 个字

提示

此小节暂未更新!作者正在疯狂制作中……

欢迎在评论区留下你的想法