GtkWidget Class

The GtkWidget class is the base class for all the other classes in the GtkRxDlg class heirarchy. You should NOT instantiate this class directly, instead you should instantiate the children of this class. However, feel free to utilize the methods in this class to manipulate your child widgets.

This class subclasses the Object REXX Object class so all of its methods are also available to this class.

The class heirarchy


   Object
      +---GtkWidget

The methods for the GtkWidget class are documented below.

GtkWidget Method Table of Contents

access - Return the accessibility object
destroy - Destroy the widget and any children
font - Get the default font for the widget
font = - Set the default font for the widget
grabfocus - Set the keyboard focus to the widget
hide - Hide the widget
hideall - Hide the widget and any children
name - Get the widget name
name = - Set the widget name
pointer - Get the pointer to the internal object
sensitive = - Enable/disable a widget
setsize - Set the size of the widget
show - Show the widget
showall - Show the widget and all child widgets


Method: access

This method returns the accessibility object.

Example

This is a example of how to get the accessibility object.


accessobj = mywidgit~access()

Method Parameters

None.

Method Results

accessobj
An AtkObject. See the AtkObject methods.



Method: destroy

This method destroys the widget and any children dependent on this widget. It also sets the pointer value to zero making the internal object unavailable.

Example

This is a example of how to destroy a widget.


mywidgit~destroy()

Method Parameters

None.

Method Results

None.




Method: font

This method gets the font used by the widget for displaying text.

Example

This is a example of how to get the widget's font.


fontname = mywidget~font()

Method Parameters

None.

Method Results

fontname
The name and size of the font. Note that this string is in the form acceptable to the new GTK+ 2.0 font subsystem.



Method: font =

This method sets the font used by the widget for displaying text.

Example

This is a example of how to set the widget's font.


mywidget~font = 'Courier 10'

Method Parameters

fontname/size
The name and size of the new font. Note that this argument must be in the form acceptable to the new GTK+ 2.0 font subsystem.

Method Results

None




Method: grabfocus

This method sets the keyboard focus to the widget.

Example

This is a example of how to set the focus to a widget.


mywidget~grabfocus()

Method Parameters

None.

Method Results

None.




Method: hide

Hide a widget.

Example


mywidgit~hide()

Method Parameters

None

Method Results

None.




Method: hideall

Hide a widget and any dependent child widgets.

Example


mywidgit~hideall()

Method Parameters

None

Method Results

None.




Method: name

Returns the name of the widget.

Example

This is a example of how to retrieve the widget name.


myname = mywidget~name()

Method Parameters

None

Method Results

myname
The name of the widget.



Method: name =

Sets the name of the widget.

Example

This is a example of how to set the widget name.


newname = 'OkButton'
mywidget~name(newname)

Method Parameters

newname
The new name of the widget.

Method Results

None




Method: pointer

Returns the pointer to the internal widget data structure. You probably will never use this method but it is here for debugging.

Example

This is a example of how to retrieve the internal pointer.


internal_pointer = mywidget~pointer()

Method Parameters

None

Method Results

internal_pointer
The pointer to the internal widget structure. This can be used for debugging purposes.



Method: sensitive =

This method enables/disables a widget.

Example

This is a example of how to enable/disable a widget.


flag = .false /* disable the widget */
mywidget~sensitive = flag

flag = .true /* enable the widget */
mywidget~sensitive = flag

Method Parameters

flag
.true to enable the widget and .false to disable the widget.

Method Results

None




Method: setsize

This method sets the size of the widget (in pixels). Normally, you should let the size of a widget default to its initial value when instantiated (0, 0) which lets the widget adjust its own size to an optimal display value.

Example

This is a example of how to set the widget's size.


width = 200
height = 100
mywidget~setsize(width, height)

Method Parameters

width
The new width in pixels. A value of zero allows the widget to adjust its width to an optimal value for display.
height
The new width in pixels. A value of zero allows the widget to adjust its height to an optimal value for display.

Method Results

None




Method: show

This method shows the widget.

Example

This is a example of how to show a widget.


mywidget~show()

Method Parameters

None.

Method Results

None




Method: showall

This method shows the widget and any dependent/contained child widgets.

Example

This is a example of how to show a widget and all its child widgets.


mywidget~showall()

Method Parameters

None.

Method Parameters

None.




Valid XHTML 1.0!