Skip to main content

tkscrollutil

文档 主页

PyPI PyPI - Downloads PyPI - License


ScrolllArea

可以快速地为水平滚动、垂直滚动组件设置滚动条

属性

autohidescrollbars 设置组件是否自动隐藏滚动条。布尔数值。默认False。也就是说,当你把鼠标指针放到滚动条上时,滚动条才会显示。

lockinterval 设置组件滚动条地锁定间隔。整数数值。默认300.

respectheader 仅当将嵌入到组件内地tablelist版本为6.5及以上版本时才能使用,后续等开发出tablelist的扩展库时补充

respecttitlecolumns 仅当将嵌入到组件内地tablelist版本为6.5及以上版本时才能使用,后续等开发出tablelist的扩展库时补充

xscrollbarmode 设置水平滚动条的模式。可选值为static dynamic none。默认none。static为常驻滚动条;dynamic为自动滚动条;none为没有滚动条

yscrollbarmode 设置垂直滚动条的模式。可选值为static dynamic none。默认static。static为常驻滚动条;dynamic为自动滚动条;none为没有滚动条

方法

setwidget 设置具有滚动条属性的组件,使组件快速设置滚动条。

示例

from tkinter import Tk, Listbox
from tkscrollutil import ScrollArea

Window = Tk()

Area = ScrollArea(Window)
List = Listbox(Area)
for Item in range(50):
    List.insert(Item+1, Item+1)
Area.setwidget(List)
Area.pack(fill="both", expand="yes")

Window.mainloop()

ttkScrollArea

见上方。与ScrollArea不同的是,ttkScrollArea具有ttk组件的属性,并且ScrollArea和ttkScrollArea不能同时使用。

示例

from tkinter import Tk, Listbox
from tkscrollutil import ttkScrollArea

Window = Tk()

Area = ttkScrollArea(Window)
List = Listbox(Area)
for Item in range(50):
    List.insert(Item+1, Item+1)
Area.setwidget(List)
Area.pack(fill="both", expand="yes")

Window.mainloop()

ScrollSync

同步滚动条,当其中一个滚动时,另一个也会跟随着移动起来。

方法

setwidgets 设置同步滚动的组件。需输入列表,如 [widget1, widget2] 。

widgets 获取同步滚动的组件。

示例

from tkinter import Tk, Listbox, Frame
from tkscrollutil import ScrollArea, ScrollSync
Window = Tk()

Frame = Frame()

Area = ScrollArea(Frame, yscrollbarmode="static")
Sync = ScrollSync(Area)
Area.setwidget(Sync)

Area.pack(fill="y", side="right")

List1 = Listbox()
List1.pack(fill="both", side="left", expand="yes")
List2 = Listbox()
List2.pack(fill="both", side="right", expand="yes")

for Item in range(300):
    List1.insert(Item, Item)
    List2.insert(Item, Item)

Sync.setwidgets([List1, List2])

Frame.pack(fill="both", expand="yes")

Window.mainloop()

ttkScrollSync

见上方。与ScrollSync不同的是,ttkScrollSync具有ttk组件的属性,并且ScrollSync和ttkScrollSync不能同时使用。

示例

from tkinter import Tk, Listbox, Frame
from tkscrollutil import ttkScrollArea, ttkScrollSync
Window = Tk()

Frame = Frame()

Area = ttkScrollArea(Frame, yscrollbarmode="static")
Sync = ttkScrollSync(Area)
Area.setwidget(Sync)

Area.pack(fill="y", side="right")

List1 = Listbox()
List1.pack(fill="both", side="left", expand="yes")
List2 = Listbox()
List2.pack(fill="both", side="right", expand="yes")

for Item in range(300):
    List1.insert(Item, Item)
    List2.insert(Item, Item)

Sync.setwidgets([List1, List2])

Frame.pack(fill="both", expand="yes")

Window.mainloop()

ttkScrolledNoteBook

scrollutil本身不提供ScrolledNoteBook,只有ttk能够提供。

from tkinter import Tk, Frame
from tkscrollutil import ttkScrolledNoteBook, addclosetab
Window = Tk()

NoteBook = ttkScrolledNoteBook(Window)

addclosetab("TNotebook")

NoteBook.add(Frame(NoteBook), text="Hello World")
NoteBook.pack(fill="both", expand="yes")

Window.mainloop()

Metadata

Release files for tkscrollutil 1.3.117

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tkscrollutil 1.3.117
File Size Uploaded Provenance
tkscrollutil-1.3.117.tar.gz 84.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tkscrollutil 1.3.117
File Interpreter ABI Platform
tkscrollutil-1.3.117-py3-none-any.whl Python 3 none any Details

Total release size: 179.5 kB

Release files / tkscrollutil-1.3.117.tar.gz

Download URL tkscrollutil-1.3.117.tar.gz
Size 84.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d3a7dc3df3ae4f4db76fea111ad3161e9f8face9925a77e368bb82cb86949478
BLAKE2b-256 checksum
How to use checksums
9bac58c5712cdbe67d0c297f1f8c4ce0f77f03001819a00fbb597a5a58c24afa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / tkscrollutil-1.3.117-py3-none-any.whl

Download URL tkscrollutil-1.3.117-py3-none-any.whl
Size 95.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0a7392330a35f1b9e43ec174cc3ba51d0e2e52625a734d76dd8118bf7561f2c
BLAKE2b-256 checksum
How to use checksums
81720c58a9390437339b833d1260e0ee43b3359772e6a6437ab283cfc3382531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for tkscrollutil 1.3.117

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page