Ruby-tk-messagebox

提供:Dev Guides
移動先:案内、検索

Ruby/TK-メッセージボックスウィジェット

標準オプション

NA

ウィジェット固有のオプション

Sr.No. Options & Description
1

icon ⇒ String

messageBoxのアイコンを指定します。 有効な値は error 、 info 、 question 、または warning です。

2

type ⇒ String

messageBoxのタイプを指定します。 有効な値は、 abortretryignore 、 ok 、 okcancel 、 retrycancel 、 yesno 、または yesnocancel です。 タイプによって、表示するボタンが決まります。

3

default ⇒ String

デフォルトのボタンを指定します。 これは、前に指定したmessageBoxのタイプに応じて、 abort 、 retry 、 ignore 、 ok 、 cancel 、 yes 、または no のいずれかでなければなりません。

4
  • detail *⇒ String

messageBoxの詳細領域のテキストを指定します。

5
  • message *⇒ String

messageBoxのメッセージテキストを指定します。

6
  • title* ⇒ String

messageBoxのタイトルを指定します。

イベントバインディング

NA

例

require 'tk'

root = TkRoot.new
root.title = "Window"

msgBox = Tk.messageBox (
   'type'    => "ok",
   'icon'    => "info",
   'title'   => "This is title",
   'message' => "This is message"
)
Tk.mainloop

これは、次の結果を生成します-

Ruby/Tk MsgBox