Source code for thurible.menu

"""
text
~~~~

An object for displaying a text area in a terminal.
"""
from dataclasses import dataclass
from typing import Optional

from blessed import Terminal
from blessed.keyboard import Keystroke

from thurible.panel import Scroll, Title
from thurible.util import Box


# Utility classes.
@dataclass
class Option:
    """A command or menu option.

    :param name: The name of the option.
    :param hotkey: (Optional.) A hotkey that can be used to invoke
        the option.
    """
    name: str
    hotkey: Optional[str] = None


# General classes.