📄 messagebox.n
字号:
'\"'\" Copyright (c) 1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) messageBox.n 1.5 96/09/19 17:02:40'\" .so man.macros.TH tk_messageBox n 4.2 Tk "Tk Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEtk_messageBox \- pops up a message window and waits for user response..SH SYNOPSIS\fBtk_messageBox \fR?\fIoption value ...\fR?.BE.SH DESCRIPTION.PPThis procedure creates and displays a message window with anapplication-specified message, an icon and a set of buttons. Each ofthe buttons in the message window is identified by a unique symbolicname (see the \fB\-type\fR options). After the message window ispopped up, \fBtk_messageBox\fR waits for the user to select one of thebuttons. Then it returns the symbolic name of the selected button.The following option-value pairs are supported:.TP\fB\-default\fR \fIname\fR\fIName\fR gives the symbolic name of the default button forthis message window ('ok', 'cancel', and so on). See \fB\-type\fR for a list of the symbolic names. If the message box has just onebutton it will automatically be made the default, otherwise if thisoption is not specified, there won't be any default button..TP\fB\-icon\fR \fIiconImage\fRSpecifies an icon to display. \fIIconImage\fR must be one of thefollowing: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or\fBwarning\fR. If this option is not specified, then no icon will bedisplayed..TP\fB\-message\fR \fIstring\fRSpecifies the message to display in this message box..TP\fB\-parent\fR \fIwindow\fRMakes \fIwindow\fR the logical parent of the message box. The messagebox is displayed on top of its parent window..TP\fB\-title\fR \fItitleString\fRSpecifies a string to display as the title of the message box. Thedefault value is an empty string..TP\fB\-type\fR \fIpredefinedType\fRArranges for a predefined set of buttons to be displayed. Thefollowing values are possible for \fIpredefinedType\fR:.RS.TP 18\fBabortretryignore\fRDisplays three buttons whose symbolic names are \fBabort\fR,\fBretry\fR and \fBignore\fR..TP 18\fBok\fRDisplays one button whose symbolic name is \fBok\fR..TP 18\fBokcancel\fRDisplays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR..TP 18\fBretrycancel\fRDisplays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR..TP 18\fByesno\fRDisplays two buttons whose symbolic names are \fByes\fR and \fBno\fR..TP 18\fByesnocancel\fRDisplays three buttons whose symbolic names are \fByes\fR, \fBno\fRand \fBcancel\fR..RE.PP.SH EXAMPLE.CSset answer [tk_messageBox \-message "Really quit?" \-type yesno \-icon question]case $answer { yes exit no {tk_messageBox \-message "I know you like this application!" \-type ok}}.CE.SH KEYWORDSmessage box
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -