## Tcl9.0.3/Tk9.0.3 Documentation > Tk Commands > dialog

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

  NAME
    tk_dialog — 排他的対話箱を作り応答を待つ Create modal dialog and wait for response
  構文 SYNOPSIS
  説明 DESCRIPTION
    window
    title
    text
    bitmap
    default
    string
  用例 EXAMPLE
  SEE ALSO
  KEYWORDS

### NAME

tk_dialog — 排他的対話箱を作り応答を待つ Create modal dialog and wait for response

### 構文 SYNOPSIS

tk_dialog window title text bitmap default string string ...

### 説明 DESCRIPTION

この手続函数は Tk 記述譜外部函数群の一部である｡ This procedure is part of the Tk script library. It is largely deprecated by the tk_messageBox. Its arguments describe a dialog box:

window
  対話箱の為に使用する頂上水準の窓の名前｡この名前の既存の窓はどれも破壊される｡ Name of top-level window to use for dialog. Any existing window by this name is destroyed.

title
  対話箱の為の窓管理用の表題帯に現れる文章｡ Text to appear in the window manager's title bar for the dialog.

text
  対話機能箱の頂部に現れる伝達文｡ Message to appear in the top portion of the dialog box.

bitmap
  もし非空ならば､対話箱の頂部に現れる点地図( Tk_GetBitmap に適した形式で)を文章の左に指定する｡もし空文字列であると､対話箱内に展示される点地図はない｡ If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap) to display in the top portion of the dialog, to the left of the text. If this is an empty string then no bitmap is displayed in the dialog.

default
  これが零又はそれ以上の整数であると､対話箱の省略時設定の釦の番号を与える(0 は左端の釦､以下それに続く)｡もし､零より小さいか空文字列であると､省略時設定の釦はなくなる｡ If this is an integer greater than or equal to zero, then it gives the index of the button that is to be the default button for the dialog (0 for the leftmost button, and so on). If negative or an empty string then there will not be any default button.

string
  それぞれの引数毎に一つの釦ができる｡それぞれの string は左から右の順番で釦内に表示される文を指し示す｡ There will be one button for each of these arguments. Each string specifies text to display in a button, in order from left to right.

対話箱を生成した後､ tk_dialog は使用者がマウスを使って釦の上を軽叩するか打鍵により省略時設定の釦を起動するか(もしあれば)のいずれかによって一つの釦を選択するのを待つ｡次に選択した釦の番号を返す: 0 は最左の釦､1 はその次の釦､以下同様｡もし使用者が釦の一つを選択する前に対話箱の窓が破壊されると -1 が返される｡ After creating a dialog box, tk_dialog waits for the user to select one of the buttons either by clicking on the button with the mouse or by typing return to invoke the default button (if any). Then it returns the index of the selected button: 0 for the leftmost button, 1 for the button next to it, and so on. If the dialog's window is destroyed before the user selects one of the buttons, then -1 is returned.

使用者の応答を待つ間､ tk_dialog は局所把持を設定する｡これは､その対話箱を起動する以外のどの様な応用譜の対話機能からも使用者を拒む｡ While waiting for the user to respond, tk_dialog sets a local grab. This prevents the user from interacting with the application in any way except to invoke the dialog box.

### 用例 EXAMPLE

    set reply [tk_dialog .foo "The Title" "Do you want to say yes?" \
            questhead 0 Yes No "I'm not sure"]

### SEE ALSO

tk_messageBox

### KEYWORDS

bitmap, dialog, modal
Copyright © 1992 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.