Gtk2_EntryDialog::new_simple (Previous) (Next) Gtk2_EntryDialog::run

View this page in Last updated: Sun, 05 Oct 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

Gtk2_EntryDialog::get()

Gtk2_EntryDialog::get()  -- ダイアログを表示し、テキストを取得する

説明

指定したパラメータでダイアログを作成し、それを実行して、 入力されたテキストを返します。ユーザがダイアログをキャンセルした場合は、 このメソッドは FALSE を返します。それ以外の場合は (たとえユーザが何もテキストを入力しなかったとしても)、 テキストを文字列で返します。


<?php
require_once 'Gtk2/EntryDialog.php';

$text Gtk2_EntryDialog::get(
    'What\'s your name?',       //メッセージ
    'Don\'t know'               //デフォルトのテキスト
);

if ($text !== false) {
    echo 'The name is: ';
    var_dump($text);
} else {
    echo "You cancelled\r\n";
}
?>

パラメータ

string $message

表示するメッセージ。

string $default

入力欄のデフォルトのテキスト。

GtkWindow $parent

親ウィンドウ (null でも可)。

返り値

ユーザが入力をキャンセルした場合は FALSE、 それ以外の場合はテキスト (文字列) を返します。

Gtk2_EntryDialog::new_simple (Previous) (Next) Gtk2_EntryDialog::run

Download Documentation Last updated: Sun, 05 Oct 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.