Paperl 0.0.3

Creator: railscoder56

Last updated:

Add to Cart

Description:

Paperl 0.0.3

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设置的标题栏拖动窗口时,会导致程序错误,不知道为什么

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.