← Back
Editing: dialogs.cpython-311.pyc
� �Ïc* � � � d Z ddlmZmZmZ ddlmZmZ ddlm Z ddl mZmZ ddl mZ ddlmZmZmZmZ ddlmZ dd lmZ d dlmZmZmZmZ dgZ G d � d� � ZdS )zJ Collection of reusable components for building full screen applications. � )�Optional�Sequence�Union)�has_completions� has_focus)�AnyFormattedText)� focus_next�focus_previous)�KeyBindings)�AnyContainer�DynamicContainer�HSplit�VSplit)�AnyDimension)� Dimension� )�Box�Button�Frame�Shadow�Dialogc �f � e Zd ZdZ ddededeee d e d e de ddfd �Zdefd�ZdS )r a� Simple dialog window. This is the base for input dialogs, message dialogs and confirmation dialogs. Changing the title and body of the dialog is possible at runtime by assigning to the `body` and `title` attributes of this class. :param body: Child container object. :param title: Text to be displayed in the heading of the dialog. :param buttons: A list of `Button` widgets, displayed at the bottom. � NTF�body�title�buttons�modal�width�with_background�returnc � � � |� _ |� _ |pg }t � � }t |� � dk rvt |d � � }t |d � � } |� d| �� � t � � |� d| �� � t � � |rpt t t � fd�� � t dd�� � d� � � t t |d|� � � t ddd�� � � � � g� � } n|} t � � } |� dt �� � t � � |� dt �� � t � � t t � fd�| d|�d n|||�� � �� � }� |rt |d|�� � � _ d S |� _ d S )Nr r ����left)�filter�rightc � �� � j S �N�r ��selfs ��@/usr/lib/python3/dist-packages/prompt_toolkit/widgets/dialogs.py�<lambda>z!Dialog.__init__.<locals>.<lambda>E s �� �d�i� � )� preferred�max)r �padding�padding_bottom)r0 �key_bindings� )�minr/ r. )r �height�tabzs-tabc � �� � j S r'