Paperl📃
一个使用众多扩展库与个人研究合并而成的tkinter超级扩展库。
示例🪧
按下s键可以切换主题
python -m Paperl
教程🥏
安装
首先安装Paperl库,如果需要体验最新内容,可以加上--pre选项
pip install Paperl
接下来你可以加入--upgrade选项开始更新。
pip install Paperl --upgrade
快速开始
先来一个最简单的示例文件。
from Paperl import Application, Window
App = Application()
Window = Window()
App.run(Window)
Paperl.Paperui.Widgets 基本组件库
Widget
所有组件的父类
useStyleSunValley(self, theme: Literal["light", "dark", "auto"] = "auto")
theme 主题,可设置为light浅色模式,dark暗黑模式,auto自动模式
启用太阳谷主题
getId(self)
获取组件的Id
gethWnd(self)
获取组件的窗柄(仅Windows系统)
showToast(self, title: str = "", message: str = "Message", appName: str = "Python", appIcon: str = "", timeOut: int = 0)
title通知的标题
message通知的文本消息
appName 显示通知的应用名
appIcon 显示通知的图标文件
timeOut通知的显示时间
显示通知
Application
应用程序,用于调用窗口运行等各种选项
alwaysUpdate(self, window)
window表示需要调用的窗口
一直刷新窗口,直到此窗口被销毁。
runAsync(self, window)
window表示需要调用的窗口
异步运行窗口,需安装async_tkinter_loop库
run(self, window)
window表示需要调用的窗口
正常运行窗口,直到主窗口被销毁
from Paperl import Application, Window
App = Application()
Window = Window()
App.run(Window)
Window
窗口组件
Button
按钮组件
__init__(self, parent: Widget, text: str = "")
parent 为组件父组件
text 为按钮组件的文本
setText(self, text: str)
text 组件的文本属性
设置按钮的文本属性
getText(self)
获取按钮的文本属性
onCommand(self, eventFunc: None = ...)
eventFunc 被绑定的事件函数。
绑定按钮被点击后触发的事件
buttonUseDafaultStyle(self)
将按钮主题设置为默认
buttonUseSunValleyAccentStyle(self)
设置按钮主题为太阳谷主题的Accent状态。
from Paperl import Application, Window, Button
Application = Application()
Window = Window()
Button = Button(Window)
Button.setText("Hello World")
Button.pack()
Application.run(Window)
版本
VER代表版本,后面三个数字代表版本号,最后这个数字代表更新内容的序列
0.0.1
VER0011 -> 稳定初始版本发布。
0.0.2
VER0020 -> 添加Padevel库,使用ctypes开发无需其他环境,节省安装过程
VER0021 -> 优化HeaderBar,标题也能获得标题栏同样的效果
VER0022 -> 去除Window.useStyleSunValley提示安装tkdev4的信息
VER0023 -> 加入TreeView、ListBox组件
VER0024 -> 为Paperl示例添加热键,按下s键即可切换主题
VER0025 -> 为Application和Window组件添加alwaysUpdate方法
VER0026 -> 将Paperl示例程序的标题栏背景材质设为MainWindow(仅限Windows11 22H2)
VER0027 -> 在Padevel.Windows.Dwmapi里添加dwmExtendFrameIntoClientArea组件(仅限Windows11 21H2)
VER0028 -> 为Window组件添加positionCenter方法,用于居中窗口
VER0029 -> 因为已经将SunValley主题纳入依赖库,所以去除使用主题时的提示
VER00210 -> 将Padevel.Windows.core命名为Core
VER00211 -> 完善文档
VER00212 -> 添加ToolBar组件
VER00213 -> 添加BreadcrumbBar组件
VER00214 -> 添加PanedWindow组件
VER00215 -> 添加InfoBar组件
VER00216 -> 为Entry组件加入setInvalid方法和setNotInvalid方法
0.0.3
VER0030 -> 改进对Python3.9的支持。
VER0031 -> 为Padevel.Winuser加入更多方法
笔记📓
开发时遇到了一些问题,使用ScrollText时,使用createHeaderBarEx设置的标题栏拖动窗口时,会导致程序错误,不知道为什么
Metadata
Release files for Paperl 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| Paperl-0.0.3.tar.gz | 105.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Paperl-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 234.3 kB
Release files / Paperl-0.0.3.tar.gz
| Download URL | Paperl-0.0.3.tar.gz |
|---|---|
| Size | 105.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b462759817316157313aa56bc7a5d09cd66ff340f4a0457eda0351c45bc1eddc
|
|
BLAKE2b-256 checksum How to use checksums |
06fe4e7776e4c9cd51697cb8f149e2921f41f4b100873583367fd1a2f9cf956b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / Paperl-0.0.3-py3-none-any.whl
| Download URL | Paperl-0.0.3-py3-none-any.whl |
|---|---|
| Size | 128.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8b7c7e0c30a0ad09fa59b73a21f02f9030a622b624200ce92d6e5a68c257d9e
|
|
BLAKE2b-256 checksum How to use checksums |
dfddbea52d920e857faa1725570757df3df2c0f71404d1c08e2692a6c83e96d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for Paperl 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.