semvec/pypi-packages huggingface dataset:
floating-window-framework 0.0.5
A framework for building floating window applications.

# fwf

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/youssef-attai/fwf/blob/main/LICENSE)

fwf (Floating Window Framework) is a powerful Python framework built on top of Tkinter. It allows users to create highly configurable, keyboard-driven graphical user interfaces (GUIs) that are ideal for scratchpad-style applications. With this framework, you can easily build custom alternatives to the scratchpads used with i3 or create your own keyboard-centric applications.

## Features

- Keyboard-driven: The framework is designed to provide a Vim-like experience, making it highly efficient for keyboard users. It supports customizable keybindings, allowing you to create your own keyboard shortcuts for various actions.
- Configurability: The framework offers extensive configuration options, enabling you to customize the behavior, appearance, and keybindings of your GUI applications. It provides flexibility to adapt the framework to your specific needs.
- BaseApp class: The BaseApp class serves as the foundation for building your applications. It extends the Tkinter top-level window and provides convenient features such as window management attributes, dialog-like behavior, and keybinding registration.
- Floating window support: The framework sets the necessary window manager (WM) attributes for your applications to behave like floating windows by default. This is especially useful when integrating your applications with tiling window managers like i3.
- Event-driven programming: The framework utilizes event-driven programming principles, allowing you to respond to various events, such as key presses, mouse clicks, and widget interactions, to create interactive applications.

## Getting Started

To get started with fwf, follow these steps:

1. Install the framework by running the following command:
   ```
   pip install floating-window-framework
   ```

2. Import the BaseApp class from the framework in your Python code:
   ```python
   from fwf import BaseApp
   ```

3. Create a subclass of BaseApp to define your custom application. 

4. Override the `setup_keybindings` method to add your custom keybindings:
   ```python
   class YourCustomApp(BaseApp):
    def __init__(self):
        super().__init__()

    def setup_keybindings(self):
        super().setup_keybindings()
        self.keybindings.add('h', self.hello)

    def hello(self):
        print("Hello, World!")
   ```

5. Run your application by instantiating your subclass and calling the `run()` method:
   ```python
   app = YourCustomApp()
   app.run()
   ```

For more details and examples, please refer to the [example](https://github.com/youssef-attai/fwf/blob/main/example/) provided.

## Contributing

Contributions are welcome! If you find any issues, have suggestions, or want to contribute new features or improvements, please feel free to open an issue or submit a pull request.

## License

This project is licensed under the MIT License. See the [LICENSE](https://github.com/youssef-attai/fwf/blob/main/LICENSE) file for more information.