The tkintertools is a UI framework based on the Canvas class of tkinter. In other words, all the UI is drawn in Canvas!
MIT License
Published by Xiaokang2022 about 1 month ago
🟢 Added / 新增
Implemented the ability to play videos, see https://github.com/Xiaokang2022/tkintertools-media
实现了播放视频的功能,见:https://github.com/Xiaokang2022/tkintertools-media
Added a parameter called anchor
to Image
Image
增加了一个名为 anchor
的参数
Added some aliases
增加了一些别名
Added method resize
to class PhotoImage
类 PhotoImage
增加了方法 resize
Added a callback
parameter to the set
method of the relevant widget to control whether the callback function is also called when the method is called
相关小部件的 set
方法增加了参数 callback
来控制当该方法被调用时回调函数是否被调用
🟡 Changed / 变更
Changed default value of parameter anchor
of Text
修改了 Text
的参数 anchor
的默认值
Changed the API of SegmentedButton
修改了 SegmentedButton
的 API
🟣 Fixed / 修复
Fixed a bug where widget SegmentedButton
had incorrect function bindings
修复了 SegmentedButton
的函数绑定不正确的 bug
Fixed a bug where disabling styles would not recalculate
修复了禁用样式不会重复计算的 bug
Fixed a bug where fonts could not be loaded on Linux OS
修复了字体加载函数在 Linux 操作系统上不生效的 bug
Fixed a bug where the return value of method alpha
of class Tk
was incorrect
修复了 Tk
的方法 alpha
的返回值不正确的 bug
Fixed a bug where some methods of class Tk
were called and the window style was lost
修复了类 Tk
的某些方法被调用时会导致窗口丢失样式的 bug
Fixed some incorrect type hints and missing parameters
修复了一些不正确的类型提示和丢失的参数
Fixed a bug where the widget Image
must be forced to initialize the image parameter, otherwise an error may be reported
修复了小部件 Image
必须强制指定图片,否则会报错的 bug
🔵 Optimized / 优化
Optimized method shutdown
of class Tk
优化了类 Tk
的方法 shutdown
The font loading function has been optimized so that parameter private
has a certain effect on Linux systems
字体加载函数被优化使得其 private
参数能在 Linux 操作系统上产生一定的作用
Class MoveTkWidget
has been optimized to prevent it from getting widget data that is not up to date
类 MoveTkWidget
被优化以防止其获取到的小部件数据不是最新的
Improved doc string
改善了文档字符串
🔴 Removed / 移除
transient
of class Toplevel
Toplevel
的初始化参数 transient
🟢 Added / 新增
The widget Text
added methods get
and set
to get and modify its text content
小部件 Text
添加了 get
和 set
方法,用于获取和修改其文本内容
Added widget Image
添加了小部件:Image
Added container widget Frame
to assist with layout
添加了容器小部件 Frame
以协助布局
The container widget Canvas
has added the method clear
to clear everything drawn inside it
容器小部件 Canvas
添加了 clear
方法,以清除其中绘制的所有内容
Widgets can now be nested within widgets
小部件现在可以嵌套在小部件中了
The submodule tools
added a function get_text_size
to get the size of the text
子模块 tools
添加了一个函数 get_text_size
用于获取文本的大小
Added the incomplete Select All function, which can select all, but due to the imperfection of the function of selecting the text with the mouse, the Select All function cannot select the undisplayed text
新增了不完整的全选功能,可以全选,但由于鼠标选择文本的功能不完善,导致全选功能无法选择未显示的文本
virtual.Widget
has a new method called detect
to determine the range based on the data of the widget itself
virtual.Widget
新增了一个名为 detect
的方法,其根据小部件本身的数据确定的范围来进行检测
Added HalfRoundedRectangular
shape class
添加了形状类 HalfRoundedRectangular
Added widget: ToggleButton
添加了小部件:ToggleButton
Added widget: SegmentedButton
添加了小部件:SegmentedButton
Added widget: SpinBox
添加了小部件:SpinBox
The subpackage standard
added an internal submodule _auxiliary
to define some auxiliary widgets
子包 standard
添加了一个内部子模块 _auxiliary
来定义一些辅助小部件
The GOLDEN_RATIO
constant has been added
增加了常量 GOLDEN_RATIO
Added experimental implementations of widgets OptionButton
and ComboBox
添加了小部件 OptionButton
和 ComboBox
的实验性实现
🔴 Removed / 移除
The code for the matplotlib
related interface part is separated
将 matplotlib
相关接口部分的代码分离了
Due to some conflicts, the binding and handling of the mouse double-click event has been removed
由于存在一些冲突,删除了鼠标双击事件的绑定和处理
🟡 Changed / 变更
Re-change the text defaults of the widget to an empty string
将小部件的文本默认值重新更改为空字符串
Rename the widgets Entry
and Information
to InputBox
and Text
, respectively
将小部件 Entry
和 Information
分别重命名为 InputBox
和 Text
The "Feature" suffix has been added to the class names of several Feature
classes to prevent them from being indistinguishable from the Widget
class in the error message
“Feature” 后缀已添加到多个 Feature
类的类名中,以防止它们与错误消息中的 Widget
类无法区分
🔵 Optimized / 优化
Optimized decision detection for Oval
and SemicircularRectangle
优化了 Oval
和 SemicircularRectangle
的检测判定方法
The Switch
widget added more animations
Switch
添加了更多动画
Shape
scaling has been improved: the scale has been changed from direct scaling to calculating the position to prevent the proportions of some parts from being broken
改进了 Shape
的缩放:缩放已从直接缩放更改为计算位置后缩放,以防止某些部分的比例被破坏
All widgets that involve text now do not need to be forced to specify the size at initialization, and it automatically calculates the size of text without line breaks
现在,所有涉及文本的小部件都不需要在初始化时强制指定大小,它会自动计算没有换行符的文本的大小
Optimized the RoundedRectangle
subclass of the Shape
class
优化了 Shape
的子类 RoundedRectangle
Improved the docstrings, error messages, and warning messages
改善了文档字符串、错误消息和警告消息
🟣 Fixed / 修复
Fixed a bug where IconButton
was missing style files
修复了 IconButton
缺少样式文件的 bug
Fixed a bug where the Slider
could be activated unexpectedly when disabled
修复了 Slider
在禁用时可能会意外激活的 bug
Fixed a bug where text had no effect on modifying its properties after scaling
修复了文本在缩放后修改其属性不起作用的 bug
Fixed a bug where some widgets with default values could repeatedly call the method set
, causing the widget appearance to be misaligned
修复了某些具有默认值的小部件可能会重复调用方法 set
从而导致小部件外观错位的 bug
Fixed a bug where some highly custom widgets would report an error when zooming
修复了某些高度自定义的小部件在缩放时会报错的 bug
🟤 Refactored / 重构
Refactored the style
subpackage, reformatted the style file, and now supports two ways to import themes. That is, import as a JSON file, or directly import using a Python file
重构了 style
子包,重新格式化了样式文件,现在支持两种导入主题的方式。即使用 JSON 文件导入,或直接使用 Python 文件导入
Removed the original JSON format style file, and added theme
subpackage to store the style data as a Python file, so as to solve the bug that the default style file is lost in project packaging
移除了原有的 JSON 格式样式文件,并添加了 theme
子包,将样式数据存储为 Python 件,从而解决了项目打包时默认样式文件丢失的 bug
Published by Xiaokang2022 3 months ago
🟢 Added / 新增
The widget Entry
has a new parameter placeholder
to display the prompt information
小部件 Entry
新增了参数 placeholder
来实现提示信息的显示
Added parameter show
to the widget Entry
to mask characters (e.g. password box)
小部件 Entry
新增了参数 show
来实现字符的掩盖(如密码框)
The new parameter align
has been added to the widget Entry
to achieve a similar effect to the text-align
of tags in HTML, i.e. the left, right, and center layout of the text
小部件 Entry
新增了参数 align
来实现于 HTML 里的标签的 text-align
类似的效果,即文本的靠左、靠右和居中布局
The widget Entry
has been added to move the text prompt by pressing the left and right keys on the keyboard
小部件 Entry
新增了通过按下键盘的左右键来移动文本提示符的功能
Added text selection to the widget Entry
小部件 Entry
新增了文本选中的功能
The widget Entry
has added shortcuts to copy (Ctrl+C), paste (Ctrl+V) and cut (Ctrl+X)
小部件 Entry
新增了快捷键复制(Ctrl+C)、粘贴(Ctrl+V)和剪切(Ctrl+X)的功能
Added widget slider (Slider
)
新增了小部件滑动条(Slider
)
Added widget icon button (IconButton
)
新增了小部件图标按钮(IconButton
)
Added some missing docstrings
增加了部分缺失的文档字符串
🟡 Changed / 变更
The color of the widget Entry
has been changed slightly under Windows 10 to enhance the look
小部件 Entry
在 Windows 10 操作系统下的颜色略有改变,以提升观感
The position of the text of the widget Entry
in the text box has been slightly corrected to improve the look
小部件 Entry
的文本在文本框中的位置被稍微修正了一下,以提升观感
🟣 Fixed / 修复
Entry
in some cases would cause the program to loop in an endless loopEntry
某些情况下删除文本会导致程序死循环的问题🔵 Optimized / 优化
🔴 Removed / 移除
Widget Entry
removed the parameters justify
and anchor
小部件 Entry
移除了参数 justify
和 anchor
Removed the 3D part of the code and related theme files
移除了 3D 部分代码以及相关主题文件
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
Published by Xiaokang2022 4 months ago
🟢 Added / 新增
The docstrings for a portion of the code has been added
添加了一部分代码的文本字符串
animation.animations
has added class MoveTkWidget
to move a tkinter widget
animation.animations
新增类 MoveTkWidget
来移动一个 tkinter 小部件
core.containers.Canvas
added the parameter name
to bind the theme
core.containers.Canvas
新增参数 name
来绑定主题
core.containers.Canvas
added method _zoom_children
to scale the tkinter widget of the Place layout
core.containers.Canvas
新增方法 _zoom_children
来实现对 Place 布局的 tkinter 小部件的缩放
Introduce the optional third-party package pillow
and add a new class PhotoImage
in toolbox.enhanced
to improve image scaling performance
引入可选的第三方包 pillow
并在 toolbox.enhanced
新增类 PhotoImage
以提高图片缩放的性能
Introduce an optional third-party package matplotlib
and add a new module mpl
to toolbox
to achieve compatibility with matplotlib
related interfaces
引入可选的第三方包 matplotlib
并在 toolbox
中新增模块 mpl
来实现对 matplotlib
相关接口的兼容
toolbox.tools
adds the function get_hwnd
to fetch the HWND of the widget
toolbox.tools
新增函数 get_hwnd
来实现小部件的 HWND 的获取
toolbox.tools
adds a new function embed_window
to embed a widget into another widget, which only works on Windows
toolbox.tools
新增函数 embed_window
来将一个小部件嵌入到另外一个小部件中,仅在 Windows 系统中有效
toolbox.tools
adds a new function screen_size
to get the width and height of the screen
toolbox.tools
新增函数 screen_size
来获取屏幕的宽度和高度
toolbox.tools
adds a new function set_mouse_position
to set the mouse position, which only works on Windows
toolbox.tools
新增函数 set_mouse_position
来设置鼠标的位置,仅在 Windows 系统中有效
toolbox.tools
adds a new function _forward_methods
to implement the forwarding of class methods
toolbox.tools
新增函数 _forward_methods
来实现类方法的转发
Introduce optional third-party packages pywinstyles
, win32material
and hPyT
, and add many new parameters to style.manager.customize_window
to implement the corresponding interfaces
引入可选的第三方包 pywinstyles
、win32material
和 hPyT
并在 style.manager.customize_window
新增许多参数来实现对应的接口
🔴 Removed / 移除
Remove function color.rgb._str_to_hex
, this function is useless
移除函数 color.rgb._str_to_hex
,此函数无用
Remove class core.containers.Dialog
, this class is useless
移除类 core.containers.Dialog
,此类无用
Removed the class core.containers.ChildWindow
and there is a better way to replace it
移除类 core.containers.ChildWindow
,已有其它更好的替换方式
Remove redundant code from three.engine
in preparation for the next refactoring
移除 three.engine
中的冗余代码,为下个版本重构做准备
🟡 Changed / 变更
animation.animations.Gradient
renamed to GradientItem
animation.animations.Gradient
更名为 GradientItem
The value of core.constants.SIZE
has been changed from -24 to -20 (a value close to the system text size)
core.constants.SIZE
的值从 -24 更改为 -20(与系统文本大小接近的值)
The default size of most widgets has been reduced to accommodate the font size change
大部分小部件的默认大小缩小了,以配合字体大小的变更
style.theme
is renamed to manager
to avoid having the same name as the theme folder
style.theme
更名为 manager
,避免跟主题文件夹 theme 重名
The rules for storing theme files have been completely changed, as shown in the module docstring for style.parser
主题文件存放规则完全更改,具体见 style.parser
的模块文档字符串
style.theme.custom_window
renamed to style.manager.customize_window
style.theme.custom_window
更名为 style.manager.customize_window
three.engine.Side
renamed to three.engine.Plane
three.engine.Side
更名为 three.engine.Plane
🔵 Optimized / 优化
darkdetect
is no longer required, but optional. When this package is missing, some features will be unavailabledarkdetect
不是必需的了,而是可选的。当缺少此包,将导致部分功能不可用🟣 Fixed / 修复
Fixed some incorrect docstrings
修正了部分错误的文档字符串
Fixed an issue where the subject response event was not removed when the window was closed
修复了窗口关闭时未删去主题响应事件的问题
Fixed an issue where the widget style did not change completely in some cases when the widget was disabled
修复了小部件禁用时,部分情况下小部件样式未完全更改的问题
🟤 Refactored / 重构
core.virtual
refactoring to remove redundant code and optimize existing code
core.virtual
重构,删去冗余代码,优化已有代码
style
refactored
style
重构
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
Published by Xiaokang2022 5 months ago
3.0.0.beta2
pip install tkintertools==3.0.0b2
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
Published by Xiaokang2022 5 months ago
P.S. English translation provided by https://cn.bing.com/translator.
After 8 months of refactoring work (10 dev releases, 7 alpha releases, 1 beta release), TkinterTools has made the leap from Gen 2 to Gen 3 🚀! But tkintertools 3 is still in a beta state, and I don't recommend using it directly in a production environment, as it currently has some issues to be resolved, and the API may not be fully determined.
经过 8 个月的重构工作(10 个 dev 版本,7 个 alpha 版本,1 个 beta 版本),tkintertools 已经从第 2 代版本跃升至第 3 代了 🚀!但 tkintertools 3 仍处于一个测试状态,我不推荐你直接再生产环境中使用它,因为它目前存在一些问题有待解决,而且 API 可能也没有完全确定。
In conclusion, tkintertools 3
has entered the public beta state 🎉! You can install it with the following command:
总之,tkintertools 3
进入了 beta 版本的公开测试状态 🎉!你可以通过下面的命令来安装它:
pip install tkintertools==3.0.0b1
But no matter what, I would like to thank everyone for their support of this project ❤️! I hope that there will be more and more ⭐ in this project!
但无论如何,我都要感谢大家对本项目的支持 ❤️ !希望本项目的 ⭐ 可以越来越多吧!
[!NOTE]
Due to the large number of updates, I won't release it here, you can go to the changelog on the official website of tkintertools to view!
由于更新内容较多,这里就不放出来了,大家可以去 tkintertools 官网更新日志进行查看!
The following preview pictures are all the effects produced by the same Demo, there are many Demo codes, and they are not shown here, you can go to the official website of tkintertools Update Notes to view.
下面的预览图都是同一个 Demo 产生的效果,Demo 代码较多,这里同样不展示,大家可自行去 tkintertools 官网更新说明处查看。
Unfortunately, there is no documentation available for your reference.
不过有件事很遗憾,就是目前并没有可用的文档供大家参考。
Thank you to my friends who helped me test on other platforms!
感谢帮助我对其它平台测试的朋友们!