Gtk2_EntryDialog
[ class tree: Gtk2_EntryDialog ] [ index: Gtk2_EntryDialog ] [ all elements ]

Class: Gtk2_EntryDialog

Source Location: /Gtk2_EntryDialog-1.0.0/Gtk2/EntryDialog.php

Class Overview

GtkMessageDialog
   |
   --Gtk2_EntryDialog

Dialog message box with text entry field.


Author(s):

Version:

  • CVS: $Id: EntryDialog.php,v 1.2 2006/04/06 04:12:06 cweiske Exp $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 23]
Dialog message box with text entry field.

There are three modes to use it:

  • Normal constructor with (somewhat complicated) parameters as known from GtkMessageDialog.
  • new_simple() static method constructor with only one required parameter.
  • Static get() method that just returns the inputted text instead of the dialog itself. This is the most convenient and code-saving method to get an input.
Even when the dialog has an OK button only, the user can cancel it by closing the window.

  • Version: CVS: $Id: EntryDialog.php,v 1.2 2006/04/06 04:12:06 cweiske Exp $
  • License: LGPL
  • Author: Christian Weiske <cweiske@php.net>


[ Top ]


Method Detail

__construct (Constructor)   [line 50]

Gtk2_EntryDialog __construct( GtkWindow $parent, GtkDialogFlags $flags, GtkMessageType $type, GtkButtonsType $buttons, string $message, [string $default = null])

Normal constructor.

Parameters are the same as for GtkMessageDialog.


Parameters:

GtkWindow   $parent     Parent window (can be null)
GtkDialogFlags   $flags     Dialog flags (use 0 as default)
GtkMessageType   $type     Message type (e.g. Gtk::MESSAGE_QUESTION)
GtkButtonsType   $buttons     Buttons to show (e.g. Gtk::BUTTONS_OK)
string   $message     Message to display
string   $default     Default text for the entry

[ Top ]

get   [line 111]

string get( string $message, string $default, [GtkWidget $parent = null])

Creates a dialog with the given parameters (@see new_simple), 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.

  • Return: Text input by the user

Parameters:

string   $message     Message/question to display
string   $default     Default entry text
GtkWidget   $parent     Parent widget if any

[ Top ]

getText   [line 228]

string getText( )

Alias for get_text().
  • Return: The input from the user

[ Top ]

get_text   [line 158]

string get_text( )

Retrieves the text from the entry
  • Return: The input from the user

[ Top ]

new_simple   [line 87]

Gtk2_EntryDialog new_simple( string $message, [string $default = null], [GtkWidget $parent = null])

Simplified constructor with not so much parameters.

Message type is Gtk::MESSAGE_QUESTION, the flags will be Gtk::DIALOG_MODAL if the parent is set. Only one OK button will be visible.

  • Return: Entry dialog instance

Parameters:

string   $message     Message/question to display
string   $default     Default entry text
GtkWidget   $parent     Parent widget if any

[ Top ]

onActivateEntry   [line 184]

void onActivateEntry( )

Callback for the entry text.

Activates the default button.


[ Top ]

run   [line 132]

int run( )

Show the dialog and block until a button has been pressed.
  • Return: The response id of the pressed button.

[ Top ]

setDefaultResponse   [line 204]

void setDefaultResponse( int $response_id)

Alias for set_default_response()

Parameters:

int   $response_id     Response code

[ Top ]

setText   [line 216]

void setText( string $text)

Alias for set_text().

Parameters:

string   $text     The text to set

[ Top ]

set_default_response   [line 172]

void set_default_response( int $response_id)

Set the default response.

The button with the id will be the default one, allowing you to just press return to activate it


Parameters:

int   $response_id     Response code

[ Top ]

set_text   [line 146]

void set_text( string $text)

Sets the text for the entry

Parameters:

string   $text     The text to set

[ Top ]


Documentation generated on Thu, 16 Nov 2006 10:30:05 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.