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

Class: Structures_Form_Element_Gtk2_Button

Source Location: /Structures_Form_Gtk2-0.8.0devel/Element/Gtk2/Button.php

Class Overview

GtkButton
   |
   --Structures_Form_Element_Gtk2_Button



Variables

Methods


Child classes:

Inherited Variables

Inherited Methods


Class Details

[line 14]


[ Top ]


Class Variables

$form =

[line 22]

The Structures_Form object.
  • Access: public

Type:   object


[ Top ]



Method Detail

__construct (Constructor)   [line 35]

void __construct( Structures_Form $form, [string $label = ''], [string $text = Gtk::STOCK_OK], [ $callback = null], [array $size = null], [object $style = null])

Constructor.
  • Access: public

Overridden in child classes as:

Structures_Form_Element_Gtk2_Cancel::__construct()
Constructor. Calls parent constructor with a callback.
Structures_Form_Element_Gtk2_Submit::__construct()
Constructor. Calls parent constructor with a callback.

Parameters:

object   $form   —  The Structures_Form.
string   $label   —  The string to be used as the label.
string   $text   —  The default text (optional).
array   $size   —  The height and width of the entry (optional).
object   $style   —  The GtkStyle to apply to the entry (optional).
   $callback   — 

[ Top ]

addEventHandler   [line 265]

integer addEventHandler( string $eventName, mixed $callback)

Adds an event handler for the element.

To simplify things, all signal handlers are created with connect_simple. If you want the regular connect arguments to be passed, you must pass them in your code.

  • Return: An identifier for the callback.
  • Access: public

Parameters:

string   $eventName   —  The name of the event.
mixed   $callback   —  The callback to call when the event occurs.

[ Top ]

clearValue   [line 126]

boolean clearValue( )

Clears the current value of the element.

This method should clear the current value if possible. For example, if the widget is a GtkEntry, this method should pass null to set_text(). If the value could not be cleared for some reason (the item is frozen or it is not possible to clear the value (selection type = browse)) this method should return false.

It is highly unlikely that a user really wants to clear the value of a button. Therefore, this method has been deactivated. It will always return true. If the user really wants to clear the value, they can pass null to setValue()

  • Return: true at all times.
  • Access: public

[ Top ]

freeze   [line 188]

void freeze( )

Freezes the element so that its value may not be changed.

Again this method exists only to maintain consistency in the interface. It should just pass false to set_sensitive().

To make life easier down the road this method should also call set_data('frozen', true);

  • Access: public

[ Top ]

getLabel   [line 248]

string getLabel( )

Returns the GtkLabel that identifies the element.
  • Access: public

[ Top ]

getName   [line 171]

string getName( )

Returns the element's name.

This method exists to maintain consistency in the interface. It should simply call get_name which is a GtkWidget method and should be available to all elements.

  • Access: public

[ Top ]

getType   [line 140]

string getType( )

Returns the element type.

This method must return a string identifying the element type, such as text, password, submit, etc.

  • Return: The element type.
  • Access: public

[ Top ]

getValue   [line 104]

string getValue( )

Returns element's value.

This method should return the widget's value not just some data from the widget (i.e. set with set_data()). For example if the widget is a GtkEntry, this method should call get_text(). If the widget is a GtkComboBox, this method should return the value of the column identified when the element was constructed for the given row.

  • Access: public

[ Top ]

isFrozen   [line 225]

boolean isFrozen( )

Returns whether or not the element is currently frozen.

This method should just return the value from get_data('frozen')

  • Access: public

[ Top ]

setLabel   [line 237]

void setLabel( string $label)

Sets the GtkLabel that identifies the element.
  • Access: public

Parameters:

string   $label   — 

[ Top ]

setName   [line 156]

void setName( string $name)

Sets the element name.

This method exists to maintain consistency in the interface. It should simply call set_name which is a GtkWidget method and should be avialable to all elements.

  • Access: public

Parameters:

string   $name   — 

[ Top ]

setValue   [line 81]

boolean setValue( string $value)

Sets an element's value.

This method should set the value of the widget not just set some data that is retrieved later. If the widget is a GtkEntry, this method should call set_text(). If the widget is a GtkComboBox, this method should set the active row.

  • Return: true if the value was changed.
  • Access: public

Parameters:

string   $value   —  The text to put in the entry.

[ Top ]

unfreeze   [line 209]

void unfreeze( )

Unfreezes the element so that its value may not be changed.

Again this method exists only to maintain consistency in the interface. It should just pass true to set_sensitive().

To make life easier down the road this method should also call set_data('frozen', false);

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.