MsgBox(3pm)

πŸ’¬ NAME πŸ’¬

okay bestie, gather round, because this is Tk::MsgBox β€” she creates and manipulates a message dialog. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

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

like… look at her. three lines and a dream 🫢


πŸŽ€ DESCRIPTION πŸŽ€

MsgBox is a simple dialog with predefined buttons. no cap, that's literally the entire concept β€” she pops up, she's cute, she has buttons you already chose from a list. main character energy in a popup window πŸ¦‹


🌸 OPTIONS 🌸

here are all the options MsgBox recognizes, and yes we're going through every single one because that's what she deserves:

  • -icon β€” pick the icon for your MsgBox. valid values are error, info, question, or warning. choose wisely, it's giving vibe check πŸ‘‘
  • -type β€” sets the type of the MsgBox. valid values are abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel. this is the one that decides which buttons show up, so it's highkey important πŸ”₯
  • -default β€” the default button, aka the one that gets the spotlight. this has to be one of abort, retry, ignore, ok, cancel, yes, or no β€” and which ones are even allowed depends on the -type you picked earlier. no mixing and matching, bestie πŸ™ˆ
  • -detail β€” the text for the detail region of the MsgBox.
  • -message β€” the message text of the MsgBox. this is the moment she speaks ✨
  • -title β€” the title of the MsgBox. her name tag, basically πŸŽ€

πŸ’œ METHODS πŸ’œ

MsgBox supports only one method as of now β€” one method, zero filler, iconic behavior:

Show()

Displays the MsgBox until the user invokes one of the buttons. Returns the name of the button invoked. so you call her, she shows up, the user clicks something, and she hands you back the button name like a little gift πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

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

This code is distributed under the same terms as Perl.


🌈 SEE ALSO 🌈

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


that's the whole page bestie, go forth and pop up dialogs responsibly πŸ’– this was MsgBox from the perl v5.40.1 docs, dated 2025-04-13, filed under User Contributed Perl Documentation β€” and yes she ate, periodt πŸ’…πŸŒΈ

πŸ“¦ where this page comes from