MsgBox(3) User Contributed Perl Documentation MsgBox(3)

# [NAME](#NAME)

Tk::MsgBox - create and manipulate a message dialog

# [SYNOPSIS](#SYNOPSIS)

```
    use Tk::MsgBox
    ...
    $d = $top->MsgBox(-title => "Title", -type => "okcancel");
    ...
    $button = $d->Show;
```

# [DESCRIPTION](#DESCRIPTION)

**MsgBox** is a simple dialog with predefined buttons.

# [OPTIONS](#OPTIONS)

The options recognized by **MsgBox** are as follows:

[**-icon**](#icon)

Specify the icon of the MsgBox. Valid values are **error**, **info**, **question**, or **warning**.

[**-type**](#type)

Specify the type of the MsgBox. Valid values are **abortretryignore**, **ok**, **okcancel**, **retrycancel**, **yesno**, or **yesnocancel**. The type determines the buttons to be shown.

[**-default**](#default)

Specify the default button. This must be one of **abort**, **retry**, **ignore**, **ok**, **cancel**, **yes**, or **no**, depending on the type of the MsgBox previously specified.

[**-detail**](#detail)

Specify text for the detail region of the MsgBox.

[**-message**](#message)

Specify the message text of the MsgBox.

[**-title**](#title)

Specify the title of the MsgBox.

# [METHODS](#METHODS)

**MsgBox** supports only one method as of now:

[**Show()**](#Show%28%29)

Displays the MsgBox until the user invokes one of the buttons. Returns the name of the button invoked.

# [AUTHOR](#AUTHOR)

Translated from Tcl/Tk by **Slaven Rezic** srezic@cpan.org

This code is distributed under the same terms as Perl.

# [SEE ALSO](#SEE_ALSO)

Tk::messageBox, Tk::DialogBox, Tk::Dialog.

2026-08-31 perl v5.44.0

---

Document: Tk::MsgBox(3pm) from perl-tk 804.036-r11 (Chainguard OS)
Source: https://github.com/eserte/perl-tk
