Scrollable containers for some GUI toolkits
Project description
Scrollable containers which just work!
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.
Tkinter
ScrollableContainers.Tk.ScrollableFrameTk
: a comprehensive implementation of a scrollable frame, and the flagship
class of this project. (I wrote the other classes just for completeness.)
Usage
Add widgets to the frame
attribute of a ScrollableFrameTk
object.
See examples.
Features
- Handles resize events correctly.
- Supports scrolling with the mouse wheel and touchpad.
- Scrolling the mouse wheel or swiping vertically with two fingers on the touchpad triggers a vertical scroll.
- Scrolling the mouse wheel while holding down Shift or swiping horizontally with two fingers on the touchpad triggers a horizontal scroll.
- Horizontally centres the contents if the window is wider.
Notes
'<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!
wxPython
ScrollableContainers.Wx.ScrollablePanelWx
: a thin wrapper around wx.lib.scrolledpanel.ScrolledPanel
.
Usage
Add widgets to the panel
attribute of a ScrollablePanelWx
object.
See examples.
Features
- Does everything the wrapped class does.
- Horizontally centres the contents if the window is wider.
PyQt5
ScrollableContainers.Qt5.ScrollableAreaQt5
: a thin wrapper around PyQt5.QtWidgets.QScrollArea
.
Usage
Add widgets to the area
attribute of a ScrollableAreaQt5
object.
See examples.
Features
- Does everything the wrapped class does.
- Horizontally centres the contents if the window is wider.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ScrollableContainers-1.0a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cf767444464a52289727db2ee234b8b5601356272efb28a264dc79583445c89 |
|
MD5 | 94162629ecdf5693fa26ce524a268164 |
|
BLAKE2b-256 | cd5720ab253c970a2450a1f084558d5a2a02304e26b5209f0c22a4b34d452f5c |
Hashes for ScrollableContainers-1.0a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c758d6c86a55aa732816f70f73fc63963bea9311f9abc8f510ac869b7a3642 |
|
MD5 | 0e30c54dcf9b37727c92e8285218dac9 |
|
BLAKE2b-256 | 4d173ad4c8cc91930459d2a0ca862ec1f3e8fb9d882efcdc3404322910f2bab0 |