Skip to main content

Encapsulates Tkinter UI elements in 'panes' that can be combined into an overall UI, integrating them by specifying callback functions and data keys.

Project description

TkPane is a Python package designed to simplify the construction of a Tkinter user interface by encapsulating one or more widgets into ‘pane’ objects that have no direct dependence on any other UI elements. Panes interact with other application elements only through a standardized interface of methods and callback functions. The tkpane package allows custom panes to be created that can be easily re-used in multiple applications. When multiple panes are assembled for use in a single UI, and some panes require data from other panes, each such dependency can be established with a simple method call. Panes that manage data (e.g., user entries) can automatically pass that data to other panes. Other application code can also easily obtain a pane’s data in the form of a Python dictionary.

The tkpane package provides the TkPane class, which should be subclassed to create pane objects that contain whatever combination of Tkinter widgets and behavior is desired. Several general-purpose custom panes are provided in the tkpane.lib package. These pane classes can be used as-is, or used as templates for the construction of other custom pane classes.

There are two types of interactions between panes that are handled by panes created with the tkpane package:

  • Actions, whereby one pane changes the state of another pane.

  • Data sharing, whereby one pane sends data to, or requests data from, another pane.

Panes created with the tkpane package, can have three actions applied to them:

  • Enable: The pane is made able to accept user input.

  • Disable: The pane is made unable to accept user input.

  • Clear: Any data displayed by the pane is removed.

Panes can also automatically perform these actions on other panes depending on whether the data that the pane manages is valid or invalid. To indicate that a pane named ok_pane should not be enabled until another pane named output_pane contains valid data, all that is necessary is to call the requires() method of ok_pane, like so:

ok_pane.requires(output_pane)

Each pane manages its own data in a Python dictionary, and when one pane enables another pane, it passes that data dictionary to the second pane’s enable() method. This is an important (but not the only) method of sharing data between panes.

Panes also automatically generate status messages describing changes to data in their widgets, and provide callback hooks to send those status messages to other panes or other application objects. Quantitative progress indicators can be handled the same way. Two of the panes in tkpane.lib are designed to accept and display status messages, and one of these is also designed to accept and display progress information.

Full documentation for the tkpane library is at http://tkpane.osdn.io/

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

tkpane-1.0.2.tar.gz (28.0 kB view details)

Uploaded Source

File details

Details for the file tkpane-1.0.2.tar.gz.

File metadata

  • Download URL: tkpane-1.0.2.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.10

File hashes

Hashes for tkpane-1.0.2.tar.gz
Algorithm Hash digest
SHA256 32c850ce4963343c6f0c9d65bb000368f2888a5e0dffb34a72cbf06c340ca81f
MD5 15da84b1e82c83b62fe6e5763950749e
BLAKE2b-256 4acd448c21a3c153d127c0229633cbc33078b9059f5842494cc8e28559659c88

See more details on using hashes here.

Supported by

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