From c2b53c31100cbe7fd40f5396e6365fbb50674d3c Mon Sep 17 00:00:00 2001 From: Xiaokang2022 <2951256653@qq.com> Date: Tue, 30 Apr 2024 00:32:07 +0800 Subject: [PATCH] Deployed 3b23290 with MkDocs version: 1.5.3 --- index.html | 4 +- news/3.0.0/News/index.html | 130 +++++++++++++++++++++++++++++++------ news/3.0.0/dark.png | Bin 19304 -> 18757 bytes news/3.0.0/light.png | Bin 18645 -> 20349 bytes search/search_index.json | 2 +- sitemap.xml | 90 ++++++++++++------------- sitemap.xml.gz | Bin 445 -> 445 bytes 7 files changed, 157 insertions(+), 69 deletions(-) diff --git a/index.html b/index.html index dbd12487..24f7bdb0 100755 --- a/index.html +++ b/index.html @@ -8,5 +8,5 @@ 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);}
跳转至

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

tkintertools

logo

tkintertoolstkinter 的一个辅助开发模块
tkintertools is an auxiliary development module of tkinter

Version License Downloads Total Downloads
Watchs Forks Stars Contributors Issues PRs Size

Insights

Star History Chart

Install - 模块安装#

Stable Release - 稳定版本#

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

Pre Release - 预发布版本#

  • Version - 最新版本 : 3.0.0.alpha5
  • Updated - 更新日期 : 2024/04/16
  • Feature - 更新内容 : News-3.0.0(pre)

-

Note - 注意

It is not recommended that you use the pre-release version directly for formal development, but it is recommended that you use the pre-release version to experience the new features and to report certain issues that you find.

不推荐你直接使用预发布版本进行正式开发,但推荐使用预发布版本来体验新功能,并上报发现的某些问题。

More - 更多#

本站统计

  • 总页面:45
  • 总字(词)数:33220
  • 总代码行数:2148
  • 总访问量:

贡献者列表

contributors
\ No newline at end of file +

Pre Release - 预发布版本#


+

Note - 注意

It is not recommended that you use the pre-release version directly for formal development, but it is recommended that you use the pre-release version to experience the new features and to report certain issues that you find.

不推荐你直接使用预发布版本进行正式开发,但推荐使用预发布版本来体验新功能,并上报发现的某些问题。

More - 更多#

本站统计

⚡快速开始 ⭐ 支持本项目 ✨最新内容


贡献者列表

contributors
\ No newline at end of file diff --git a/news/3.0.0/News/index.html b/news/3.0.0/News/index.html index cac748f1..1d348214 100755 --- a/news/3.0.0/News/index.html +++ b/news/3.0.0/News/index.html @@ -7,26 +7,114 @@ .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 - 版本发布说明#

约 407 个字 88 行代码 预计阅读时间 9 分钟

Warning - 警告

This section is still in development…
此部分仍在开发中…

Framework - 框架#

  • Version - 最新版本 : 3.0.0.alpha5
  • Last Update - 上次更新 : 2024/04/16

Change Things - 更新内容#

  • 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
    增加部分标准控件

Base Test - 基础测试#

  • Light Mode (Windows 11)

png

  • Dark Mode (Windows 11)

png

Test Code - 测试代码
import tkintertools as tkt
-
-root = tkt.Tk(title=f"tkintertools {tkt.__version__}")
-root.center()
-
-canvas = tkt.Canvas(root, free_anchor=True, keep_ratio="full", zoom_item=True)
-canvas.place(width=1280, height=720, x=640, y=360, anchor="center")
-
-tkt.Information(canvas, (100, 100), (200, 50), text="Information")
-tkt.Label(canvas, (350, 100), (100, 50), text='Label')
-tkt.Button(canvas,  (500, 100), (100, 50), text='Button')
-tkt.UnderlineButton(canvas, (650, 100), (200, 50), text='UnderlineButton')
-tkt.HighlightButton(canvas, (900, 100), (200, 50), text='HighlightButton')
-
-tkt.Switch(canvas, (100, 200), 60)
-tkt.CheckButton(canvas, (350, 200), 30, default=True)
-tkt.RadioButton(canvas, (500, 200), 24)
-tkt.ProgressBar(canvas, (650, 200), (450, 20))
-
-root.mainloop()
+    body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}      

Release Notes - 版本发布说明#

约 409 个字 176 行代码 预计阅读时间 14 分钟

Warning - 警告

This section is still in development…
此部分仍在开发中…

Framework - 框架#

  • Version - 最新版本 : 3.0.0.alpha6
  • Last Update - 上次更新 : 2024/04/30

Change Things - 更新内容#

  • 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
    完善部分小部件

Base Test - 基础测试#

  • Light Mode

png

  • Dark Mode

png

Test Code - 测试代码
"""Test"""
+
+import math
+import typing
+
+import tkintertools as tkt
+import tkintertools.animate.animations as animations
+import tkintertools.animate.controllers as controllers
+import tkintertools.constants as constants
+import tkintertools.standard.features as features
+import tkintertools.standard.shapes as shapes
+import tkintertools.standard.texts as texts
+import tkintertools.style as style
+
+root = tkt.Tk(title=f"tkintertools {tkt.__version__}")
+root.center()
+
+canvas = tkt.Canvas(root, free_anchor=True, keep_ratio="full", zoom_item=True)
+canvas.place(width=1280, height=720, x=640, y=360, anchor="center")
+
+constants.IS_WIN10 = False
+
+tkt.Information(canvas, (100, 100), (200, 50), text="Information")
+tkt.Label(canvas, (350, 100), (100, 50), text='Label')
+tkt.Button(canvas,  (500, 100), (100, 50), text='Button')
+tkt.UnderlineButton(canvas, (650, 100), (200, 50), text='UnderlineButton')
+tkt.HighlightButton(canvas, (900, 100), (200, 50), text='HighlightButton')
+
+tkt.Switch(canvas, (100, 200), 60, default=True)
+tkt.CheckButton(canvas, (350, 200), 30, default=True)
+tkt.RadioButton(canvas, (500, 200), 24)
+pb1 = tkt.ProgressBar(canvas, (650, 200), (450, 8))
+pb2 = tkt.ProgressBar(canvas, (650, 200+30), (450, 20))
+
+
+animations.Animation(2000, controllers.smooth, callback=pb1.set,
+                    fps=60, repeat=math.inf).start(delay=0)
+animations.Animation(2000, controllers.smooth, callback=pb2.set,
+                    fps=60, repeat=math.inf).start(delay=500)
+
+constants.IS_WIN10 = True
+
+tkt.Information(canvas, (100, 300), (200, 50), text="Information")
+tkt.Label(canvas, (350, 300), (100, 50), text='Label')
+tkt.Button(canvas,  (500, 300), (100, 50), text='Button')
+tkt.UnderlineButton(canvas, (650, 300), (200, 50), text='UnderlineButton')
+tkt.HighlightButton(canvas, (900, 300), (200, 50), text='HighlightButton')
+
+tkt.Switch(canvas, (100, 400), 60)
+tkt.CheckButton(canvas, (350, 400), 30, default=True)
+tkt.RadioButton(canvas, (500, 400), 24)
+pb3 = tkt.ProgressBar(canvas, (650, 400), (450, 8))
+pb4 = tkt.ProgressBar(canvas, (650, 400+30), (450, 20))
+
+
+animations.Animation(2000, controllers.smooth, callback=pb3.set,
+                    fps=60, repeat=math.inf).start(delay=1000)
+animations.Animation(2000, controllers.smooth, callback=pb4.set,
+                    fps=60, repeat=math.inf).start(delay=1500)
+
+
+constants.IS_WIN10 = False
+
+
+class MyCustomButton(tkt.Widget):
+
+    def __init__(
+        self,
+        id: int,
+        master: tkt.Canvas,
+        position: tuple[int, int],
+        size: tuple[int, int],
+        *,
+        text: str = "",
+        family: str = constants.FONT,
+        fontsize: int = constants.SIZE,
+        weight: typing.Literal['normal', 'bold'] = "normal",
+        slant: typing.Literal['roman', 'italic'] = "roman",
+        underline: bool = False,
+        overstrike: bool = False,
+        command: typing.Callable | None = None,
+    ) -> None:
+        if id == 2:
+            position[1] -= 25
+            size = 100, 100
+        tkt.Widget.__init__(self, master, position, size)
+        s1 = style.get(tkt.Button, shapes.Rectangle)
+        s2 = style.get(tkt.Button, shapes.RoundedRectangle)
+        match id:
+            case 0: shapes.Rectangle(self, styles=s1)
+            case 1: shapes.Oval(self, styles=s1)
+            case 2: shapes.RegularPolygon(self, styles=s1, side=5)
+            case 3: shapes.RoundedRectangle(self, styles=s2)
+            case 4: shapes.SemicircularRectangle(self, styles=s2)
+            case 5: shapes.SharpRectangle(self, styles=s1)
+            case 6: shapes.Parallelogram(self, styles=s1)
+        texts.Information(self, text=text, family=family, size=fontsize, weight=weight,
+                        slant=slant, underline=underline, overstrike=overstrike,
+                        styles=style.get(tkt.Button, texts.Information))
+        features.Button(self, command=command)
+
+
+for i in range(7):
+    x = 100 + i*150
+    MyCustomButton(i, canvas, [x, 550], (100, 50), text="MCB")
+
+
+root.mainloop()
 

3D Test - 3D 测试#

3D

Test Code - 测试代码
import itertools
 import math
 import random
@@ -95,7 +183,7 @@
 

In addition to this, you can also run the following Python code to start
除此之外,你还可以运行下面的 Python 代码启动

from tkintertools import designer
 
 designer.run()
-

欢迎在评论区留下你的想法