Skip to main content

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

Project description

textual-window-banner

Textual-Window

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 extremely 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.

Demo App

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

uvx textual-window 
pipx textual-window

Documentation

Click here for documentation

Questions, issues, suggestions?

Feel free to post an issue.

Video

https://github.com/user-attachments/assets/3d0e21a6-bb95-4adf-afc9-6bb3792215a5

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.3.0.tar.gz (92.3 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.3.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: textual_window-0.3.0.tar.gz
  • Upload date:
  • Size: 92.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for textual_window-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5d210a9d83b32cad67b13900c2953cc9377b8d38ee69746f944e973b96f3b1b6
MD5 9fa532ed48409d48b8f354b815a9119e
BLAKE2b-256 1b7ff72eb0754c60edd1cac481d59be205ea094ab97e2945a7b96a47faff3db9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for textual_window-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b8ac51882e13ea0dac9d877a9ae69595ab18758689319985a6ad059435315f
MD5 0809e086e8e26a5806cd05efff75ba80
BLAKE2b-256 067a5acc5338ba97a7e32930b8136b31ff1d59a5bea5c69a1e3534584af15677

See more details on using hashes here.

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