messageBox.n
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" 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.
- '"
- '" RCS: @(#) $Id: messageBox.n,v 1.5.8.1 2004/10/28 10:19:29 dkf Exp $
- '"
- .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 NAME
- tk_messageBox - pops up a message window and waits for user response.
- .SH SYNOPSIS
- fBtk_messageBox fR?fIoption value ...fR?
- .BE
- .SH DESCRIPTION
- .PP
- This procedure creates and displays a message window with an
- application-specified message, an icon and a set of buttons. Each of
- the buttons in the message window is identified by a unique symbolic
- name (see the fB-typefR options). After the message window is
- popped up, fBtk_messageBoxfR waits for the user to select one of the
- buttons. Then it returns the symbolic name of the selected button.
- The following option-value pairs are supported:
- .TP
- fB-defaultfR fInamefR
- fINamefR gives the symbolic name of the default button for
- this message window ('ok', 'cancel', and so on). See fB-typefR
- for a list of the symbolic names. If this option is not specified,
- the first button in the dialog will be made the default.
- .TP
- fB-iconfR fIiconImagefR
- Specifies an icon to display. fIIconImagefR must be one of the
- following: fBerrorfR, fBinfofR, fBquestionfR or
- fBwarningfR. If this option is not specified, then the info icon will be
- displayed.
- .TP
- fB-messagefR fIstringfR
- Specifies the message to display in this message box.
- .TP
- fB-parentfR fIwindowfR
- Makes fIwindowfR the logical parent of the message box. The message
- box is displayed on top of its parent window.
- .TP
- fB-titlefR fItitleStringfR
- Specifies a string to display as the title of the message box. The
- default value is an empty string.
- .TP
- fB-typefR fIpredefinedTypefR
- Arranges for a predefined set of buttons to be displayed. The
- following values are possible for fIpredefinedTypefR:
- .RS
- .TP 18
- fBabortretryignorefR
- Displays three buttons whose symbolic names are fBabortfR,
- fBretryfR and fBignorefR.
- .TP 18
- fBokfR
- Displays one button whose symbolic name is fBokfR.
- .TP 18
- fBokcancelfR
- Displays two buttons whose symbolic names are fBokfR and fBcancelfR.
- .TP 18
- fBretrycancelfR
- Displays two buttons whose symbolic names are fBretryfR and fBcancelfR.
- .TP 18
- fByesnofR
- Displays two buttons whose symbolic names are fByesfR and fBnofR.
- .TP 18
- fByesnocancelfR
- Displays three buttons whose symbolic names are fByesfR, fBnofR
- and fBcancelfR.
- .RE
- .PP
- .SH EXAMPLE
- .CS
- set answer [fBtk_messageBoxfR -message "Really quit?" -type yesno -icon question]
- switch -- $answer {
- yes exit
- no {fBtk_messageBoxfR -message "I know you like this application!" e
- -type ok}
- }
- .CE
- .SH KEYWORDS
- message box