Gtk2_EntryDialog::get() – Show the dialog and retrieve the text


require_once 'Gtk2/EntryDialog.php';

string Gtk2_EntryDialog::get ( string $message , string $default , GtkWindow $parent )


Creates a dialog with the given parameters, runs it, and returns the text set. If the user cancelled the dialog, this method returns FALSE. In any other case (even when the text is empty), the a string with the text is returned.

require_once 'Gtk2/EntryDialog.php';

$text Gtk2_EntryDialog::get(
'What\'s your name?',       //the message
'Don\'t know'               //The default text

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


string $message

Message to display.

string $default

Default text for the entry.

GtkWindow $parent

Parent window (can be null).

Return value

returns False if the user cancelled input, the text (string) otherwise.

Simplified constructor with not so much parameters. (Previous) Show the dialog and block until a button has been pressed. (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.