Skip to main content

使用tkinter开发高级GUI调试库

Project description

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 -> 加入TreeViewListBox组件

VER0024 -> 为Paperl示例添加热键,按下s键即可切换主题

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


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Paperl-0.0.3.tar.gz (105.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Paperl-0.0.3-py3-none-any.whl (128.8 kB view details)

Uploaded Python 3

File details

Details for the file Paperl-0.0.3.tar.gz.

File metadata

  • Download URL: Paperl-0.0.3.tar.gz
  • Upload date:
  • Size: 105.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for Paperl-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b462759817316157313aa56bc7a5d09cd66ff340f4a0457eda0351c45bc1eddc
MD5 dbf51f7c802ce44c7c7b2a0cdc8d97e8
BLAKE2b-256 06fe4e7776e4c9cd51697cb8f149e2921f41f4b100873583367fd1a2f9cf956b

See more details on using hashes here.

File details

Details for the file Paperl-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Paperl-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 128.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for Paperl-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b7c7e0c30a0ad09fa59b73a21f02f9030a622b624200ce92d6e5a68c257d9e
MD5 6f9f23732199c7acf5a3bca1ad144532
BLAKE2b-256 dfddbea52d920e857faa1725570757df3df2c0f71404d1c08e2692a6c83e96d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page