# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

PROMPT_POPUP_METADATA = Metadata(
    id="7518dc8a00d72b77b36f749f20f87fefe2a98560.boutiques",
    name="prompt_popup",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class PromptPopupOutputs(typing.NamedTuple):
    """
    Output object returned when calling `prompt_popup(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def prompt_popup(
    message_pause: str | None = None,
    buttons_b: list[str] | None = None,
    timeout_to: float | None = None,
    runner: Runner | None = None,
) -> PromptPopupOutputs:
    """
    A command-line tool that pops up a window prompting user interaction with a
    message and buttons.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/prompt_popup.html
    
    Args:
        message_pause: Same as -message to match the old prompt_user.
        buttons_b: Same as -button.
        timeout_to: Same as -timeout TT.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `PromptPopupOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(PROMPT_POPUP_METADATA)
    cargs = []
    cargs.append("prompt_popup")
    cargs.append("-message")
    if message_pause is not None:
        cargs.extend([
            "-pause",
            message_pause
        ])
    cargs.append("-button")
    if buttons_b is not None:
        cargs.extend([
            "-b",
            *buttons_b
        ])
    cargs.append("-timeout")
    if timeout_to is not None:
        cargs.extend([
            "-to",
            str(timeout_to)
        ])
    ret = PromptPopupOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "PROMPT_POPUP_METADATA",
    "PromptPopupOutputs",
    "prompt_popup",
]
