Skip to main content

A Textual widget for a floating, draggable window and included window bar/manager system.

Project description

Textual-Window

badge badge badge badge badge

Textual-Window is an extension library for Textual.

It provides a Window widget, along with an included WindowBar and WindowSwitcher, that makes it easy to create a desktop GUI-like experience inside of a TUI built with Textual.

Window widgets are floating, draggable, resizable, snappable, closable, and you can even cycle through them in a manner similar to alt-tab. It's like a mini desktop inside of your terminal. (Is it ridiculous? Yes, yes it is. But is it awesome? Also yes.)

Features

  • Drag, resize, and maximize windows. Close windows with ctrl+w.
  • Windows can focus, and highlight to show which one is focused. Controls are passed from the highlighted window to its inner scrolling container.
  • Included fully-automatic Window Bar (aka Task Bar). Don't worry about keeping track of the windows. Just compose and go. The library will track them for you.
  • Included Window Switcher, to cycle window focus in a manner similar to alt-tab. The most recently focused window is always at the start (left side).
  • Set the window's min and max size through Textual CSS as you normally would, and the window will respect those settings when resizing. Resizing can also be disabled per window.
  • Windows snap to the terminal by default, toggle this on/off in real-time.
  • WindowBar can toggle the dock between top and bottom of the screen in real-time.
  • Window Bar has right-click context menus, one for each window, as well as a global context menu with options such as close/open all or snap/unsnap all.
  • Set the window's starting location on the screen using plain descriptions (ie. right + bottom), as well as whether to initialize open or closed.
  • An optional hamburger menu for custom callbacks - The window has a 'menu_options' argument. Pass in a dictionary of functions (label + callback) and these functions will appear in that window's hamburger menu. (If nothing is passed in, the menu is not shown).
  • Smooth fade in/out animation adds a convincing touch.
  • Create windows in all 3 ways textual supports - context manager, passing in a list of children, and custom Window objects.
  • ...and many small QoL things too numerous to list here.

See the documentation for more details.

Note: This library is under pretty active development and so the API is subject to change. If you find a bug, please report it on the issues page.

Demo App

If you have uv or pipx, you can immediately try the demo app:

uvx textual-window 
pipx run textual-window

Documentation

Click here for documentation

Video

Your browser does not support the video tag.

Questions, Issues, Suggestions?

Use the issues section for bugs or problems, and post ideas or feature requests on the TTY group discussion board.

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

textual_window-0.8.0.tar.gz (127.7 kB view details)

Uploaded Source

Built Distribution

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

textual_window-0.8.0-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file textual_window-0.8.0.tar.gz.

File metadata

  • Download URL: textual_window-0.8.0.tar.gz
  • Upload date:
  • Size: 127.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for textual_window-0.8.0.tar.gz
Algorithm Hash digest
SHA256 b5fb930d933b8020c35c22f6863aeb60d4f51219c38f8d1f6a5a3b4534a9fabb
MD5 69c5d9805f80f01c7bb8ae2e3304bdc7
BLAKE2b-256 84d5cf8fbe64a9882a97622f74cb3a3e73ec438725af91c8a682a8ffcd9ee6ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for textual_window-0.8.0.tar.gz:

Publisher: release.yml on ttygroup/textual-window

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file textual_window-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: textual_window-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for textual_window-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b329c5131274e8a84d124febd88eacdc760020068daf3e539d4d954ac2add91
MD5 0e7ee9599b5dfbcd4d3a472f9d86cffb
BLAKE2b-256 26feb3b5d53d4588fed9f98f7ea946bbf1acc64f6b7055cd89a52dcd9aa60ceb

See more details on using hashes here.

Provenance

The following attestation bundles were made for textual_window-0.8.0-py3-none-any.whl:

Publisher: release.yml on ttygroup/textual-window

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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