Displaying a message box

The tk_messageBox command displays a message window with a defined message, an icon and a collection of command buttons and waits on the user's response. The return value provided is the symbolic value (see the type option in the following table) assigned to the button selected.

The syntax is as follows:

	tk_messageBox option value …

The tk_messageBox command accepts one or more option value pairs as detailed below. If no option value pairs are provided the command will display an empty window with an OK button.

Option

Interpretation

-default name

Designates which button is the default.

-detail string

Displays a secondary message to the message provided by the –message option.

-icon name

Sets the icon to display, ...

Get Tcl/Tk 8.5 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.