
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
ScrollableContainers
Advanced tools
If you have developed GUI applications, you probably know the pain of designing a clean front-end only to find that your application window is too large for your client's screen. Making the content scrollable is not straightforward (at least in Tkinter). Especially not after you have already written a lot of code to draw the content.
You can use ScrollableContainers
to reduce headaches.
It's available on PyPI!
pip install ScrollableContainers
Scrollable containers are currently available for the following GUI toolkits.
No part of the code in this repository has been written by or in consultation with artificial intelligence chatbots. All of it is purely a product of natural intelligence (or stupidity, as the case may be).
This project is not sponsored or endorsed by, or connected with, any organisation or entity such as but not limited to: the Tcl Core Team, the Python Software Foundation, the wxWidgets Team, the wxPython Team, the Qt Company and Riverbank Computing.
ScrollableContainers.ScrollableFrameTk
: a comprehensive implementation of a scrollable frame, and the flagship class
of this project. (I wrote the other classes just for completeness.)
Add widgets to the frame
attribute of a ScrollableFrameTk
object.
See examples.
"<Button-4>"
, "<Button-5>"
and "<MouseWheel>"
are bound to all widgets using bind_all
to handle mouse wheel
scroll events. Do not unbind_all
(or bind_all
another function to) these three sequences!
ScrollableContainers.ScrollablePanelWx
: a thin wrapper around wx.lib.scrolledpanel.ScrolledPanel
.
Add widgets to the panel
attribute of a ScrollablePanelWx
object.
See examples.
ScrollableContainers.ScrollableAreaQt5
/ScrollableContainers.Qt6.ScrollableAreaQt6
: a thin wrapper around
PyQt5.QtWidgets.QScrollArea
/PyQt6.QtWidgets.QScrollArea
.
Add widgets to the area
attribute of a ScrollableAreaQt5
/ScrollableAreaQt6
object.
See
examples.
In GTK, containers are widgets, so they can be aligned in other containers.
import itertools
import gi; gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window()
window.connect("destroy", Gtk.main_quit)
window.set_default_size(256, 128)
scrolled_window = Gtk.ScrolledWindow()
window.add(scrolled_window)
grid = Gtk.Grid()
grid.set_halign(Gtk.Align.CENTER)
grid.set_row_spacing(20)
grid.set_column_spacing(20)
scrolled_window.add(grid)
dim = 10
for i, j in itertools.product(range(dim), repeat=2):
label = Gtk.Label()
label.set_label(f"Label\n({i}, {j})")
grid.attach(label, j, i, 1, 1)
window.show_all()
Gtk.main()
Since horizontally centring the contents of a scrollable container is the primary function of this package, and GTK has built-in functionality to achieve the same, no submodule for PyGObject is implemented here.
FAQs
Scrollable containers for Tkinter, wxPython, PyQt5 and PyQt6
We found that ScrollableContainers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.