     [file macros.texi not included]

This file documents GTK, the GIMP Toolkit

Copyright (C) 1996 Peter Mattis Copyright (C) 1997 Peter Mattis

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Peter Mattis.

The GIMP Toolkit
****************

This is edition 1.0 of the GTK documentation, 29 January 1998.

Copying
*******

GTK is free; this means that everyone is free to use it and free to redistribute it on a free basis. GTK is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of GTK that they might get from you.

Specifically, we want to make sure that you have the right to give away copies of GTK, that you receive source code or else can get it if you want it, that you can change GTK or use pieces of it in new free programs, and that you know you can do these things.

To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of GTK, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.

Also, for my own protection, we must make certain that everyone finds out that there is no warranty for GTK. If GTK is modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will no reflect on our reputation.

The precise conditions of the licenses for GTK are found in the General Public Licenses that accompanies it.

What is GTK?
************

GTK is a library for creating graphical user interfaces similar to the Motif ``look and feel''. It is designed to be small and efficient, but still flexible enough to allow the programmer freedom in the interfaces created. GTK allows the programmer to use a variety of standard user interface widgets (see Widgets) such as push, radio and check buttons, menus, lists and frames. It also provides several ``container'' widgets which can be used to control the layout of the user interface elements.

GTK provides some unique features. (At least, I know of no other widget library which provides them). For example, a button does not contain a label, it contains a child widget, which in most instances will be a label. However, the child widget can also be a pixmap, image or any combination possible the programmer desires. This flexibility is adhered to throughout the library.

Object Overview
***************

GTK implements a semi-simple class mechanism and an associated class hierarchy for widgets and several other useful objects. The GtkObject type is the root of the class hierarchy. It provides a few items needed by all classes, the foundation for the signal (see Signals) mechanism and the ``destroy'' method.

The class hierarchy is defined by a type hierarchy. This hierarchy allows queries to be made in regards to a type. The basic query that can be performed is asking whether a given type has an ``is a'' relation with another type. For instance, it is common to ask whether a general widget pointer is a type of specific widget so that runtime sanity checks can be made.

Type utility functions
======================

The GtkTypeInfo structure is used to communicate information to gtk_type_unique as opposed to passing in large numbers of parameters.

     typedef struct _GtkTypeInfo GtkTypeInfo;

     struct _GtkTypeInfo
     {
       gchar *type_name;
       guint object_size;
       guint class_size;
       GtkClassInitFunc class_init_func;
       GtkObjectInitFunc object_init_func;
       GtkArgSetFunc arg_set_func;
       GtkArgGetFunc arg_get_func;
     }

  * The type_name field refers to the name of the type. It is convention for the type name to be the same as the C structure type. For example, the type name of the GtkObject structure is ``GtkObject''.

  * The object_size field refers to the size in bytes of the C structure. The easiest (and portable) means of computing this size is by using the C sizeof operator. For instance, the sizeof of the GtkObject structure is computed by doing sizeof (GtkObject).

  * The class_size field refers to the size in bytes of the C structure for the class. Again, the sizeof operator should be used to compute this value.

  * The class_init_func field is a callback which is used by the type mechanism to initialize class specific fields. The single argument this function takes is a pointer to a class structure.

  * The object_init_func field is a callback which is used by the type mechanism to initialize object specific fields. The single argument this functions takes is a pointer to an object structure.

 -- Function: guint gtk_type_unique (guint PARENT_TYPE, GtkTypeInfo *TYPE_INFO)
     The PARENT_TYPE is simply the value of the new types parent type. If PARENT_TYPE is 0, then the new type is the root of the type hierarchy. TYPE_INFO is a pointer to a structure which contains necessary information for construction of the new type. Specifically, the type_name, object_size and class_size fields are required. The class_init_func, object_init_func and value_init_func fields may be NULL.

 -- Function: gchar* gtk_type_name (guint TYPE)
     The returned string is the name of TYPE as specified to gtk_type_unique.

 -- Function: guint gtk_type_from_name (guchar *NAME)
     Return the type associated with NAME. If there is no type associated with NAME, then 0 will be returned.

 -- Function: guint gtk_type_parent (guint TYPE)
     Returns the parent type of TYPE or 0 if TYPE is the root of the type hierarchy.

 -- Function: gpointer gtk_type_class (guint TYPE)
     Returns the initialized class structure for TYPE. The class structure is actually created and initialized the first time it is needed. If creation and initialization occurs, the class_size field of the GtkTypeInfo structure used to initialize this type is used to determine how large the class structure is. The class_init_func field from the GtkTypeInfo structure is called for all the members in the types ancestry, including the type. The order of this invocation proceeds from the root on down. For example, the GtkWidgetClass is first initialized as an GtkObjectClass by the object class initialization routine and then by the widget class initialization routine. This allows the widget class initialization routine to override values set by the object class initialization routine. The returned structure is shared by all objects of TYPE and, as such, should not be modified.

 -- Function: gpointer gtk_type_new (guint TYPE)
     Returns a new instance of an TYPE object. The object structure is created and initialized similarly to the class structure (as described above). The object_size and object_init_func fields of the GtkTypeInfo structure are used to determine the objects allocated size and the object specific initialization routine. Similarly to the class initialization, all the object initialization routines from the root on down to the particular type being created are invoked.

 -- Function: void gtk_type_describe_heritage (guint TYPE)
     Prints the type heritage for TYPE. The heritage for a type includes the type and all its parent types up the type tree.

 -- Function: void gtk_type_describe_tree (guint TYPE, gint SHOW_SIZE)
     Prints the type tree which starts at TYPE. SHOW_SIZE is a boolean which determines whether type sizes are printed.

 -- Function: gint gtk_type_is_a (guint TYPE, guint IS_A_TYPE)
     A predicate function which determines whether the relation TYPE is_a IS_A_TYPE is true.

 -- Function: void gtk_type_get_arg (GtkObject *OBJECT, GtkType TYPE, GtkArg *ARG, guint ARG_ID)

 -- Function: void gtk_type_set_arg (GtkObject *OBJECT, GtkType TYPE, GtkArg *ARG, guint ARG_ID)

Object functions
================

The GtkObject type is the root of the type hierarchy used by GTK. It provides a minimal set of fields used to implement the actual object, class and signal mechanisms, as well as several utility routines which make dealing with objects easier.

For the adventurous, see Object Implementation.

 -- Function: guint gtk_object_get_type (void)
     Returns the GtkObject type identifier.

 -- Function: void gtk_object_class_add_signals (GtkObjectClass *CLASS, gint *SIGNALS, gint NSIGNALS)
     Adds SIGNALS to the signals field in the GtkObjectClass structure CLASS. See Signals.

 -- Function: GtkObject* gtk_object_new (guint TYPE, ...)

 -- Function: GtkObject* gtk_object_newv (guint TYPE, guint NARGS, GtkArg *ARGS)

 -- Function: void gtk_object_ref (GtkObject *OBJECT);

 -- Function: void gtk_object_unref (GtkObject *OBJECT);

 -- Function: void gtk_object_getv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS)

 -- Function: void gtk_object_set (GtkObject *OBJECT, ...)

 -- Function: void gtk_object_setv (GtkObject *OBJECT, guint NARGS, GtkArg *ARGS)

 -- Function: GtkArg* gtk_object_query_args (GtkType CLASS_TYPE, guint *NARGS)

 -- Function: void gtk_object_add_arg_type (gchar *ARG_NAME, GtkType ARG_TYPE, guint ARG_ID)

 -- Function: GtkType gtk_object_get_arg_type (gchar *ARG_NAME)

 -- Function: void gtk_object_destroy (GtkObject *OBJECT)
     Performs checks to make sure it is alright to destroy OBJECT and then emits the destroy signal. The check which is performed is to make sure OBJECT is not already processing another signal. If this were the case then destroying the object immediately would undoubtedly cause problems as the other signal would not be able to tell the object was destroyed. The solution is that if OBJECT is processing another signal we mark OBJECT is needing to be destroyed. When we finish processing of the other signal we check whether the object needs to be destroyed.

The GtkObject type provides a mechanism for associating arbitrary amounts of data with an object. The data is associated with the object using a character string key. The functions gtk_object_set_data, gtk_object_get_data, and gtk_object_remove_data are the interface to this mechanism. Two other routines, gtk_object_set_user_data and gtk_object_get_user_data, exist as convenience functions which simply use the same mechanism.

 -- Function: void gtk_object_set_data (GtkObject *OBJECT, const char *KEY, gpointer DATA)
     Associate DATA with KEY in the data list of OBJECT.

 -- Function: gpointer gtk_object_get_data (GtkObject *OBJECT, const char *KEY)
     Retrieve the data associated with KEY in the data list of OBJECT.

 -- Function: void gtk_object_remove_data (GtkObject *OBJECT, const char *KEY)
     Remove the data associated with KEY in the data list of OBJECT.

 -- Function: void gtk_object_set_user_data (GtkObject *OBJECT, gpointer DATA)
     Sets DATA into the user_data field of OBJECT.

 -- Function: gpointer gtk_object_get_user_data (GtkObject *OBJECT)
     Returns the user_data field of OBJECT.

The GtkObject type also provides a mechanism for specifying initialization values for fields. This general mechanism is called object value stacks. The reason for using value stacks is that they can simplify the life of the programmer. For instance, by default widgets are non-visible when created. However, the ``visible'' value for widgets may be specified so that widgets are made visible when created. (FIXME: unfinished).

 -- Function: void gtk_object_value_stack_new (guint OBJECT_TYPE, const gchar *VALUE_ID, GtkParamType VALUE_TYPE)

 -- Function: void gtk_object_push_value (guint OBJECT_TYPE, const gchar *VALUE_ID, ...)
     Push a value on the value stack specified by OBJECT_TYPE and VALUE_ID. The type of value is implicitly given in the context of OBJECT_TYPE and VALUE_ID. (That is, it is not specified explicitly in the function call). Only a single extra argument is expected which is the data which is to be placed on the stack.

 -- Function: void gtk_object_pop_value (guint OBJECT_TYPE, const gchar *VALUE_ID)
     Pop a value of the value stack specified by OBJECT_TYPE and VALUE_ID.

 -- Function: gint gtk_object_peek_value (guint OBJECT_TYPE, const gchar *VALUE_ID, gpointer DATA)
     Peek at the value on the top of the value stack specified by OBJECT_TYPE and VALUE_ID. The DATA argument is interpreted as the location of where to place the ``peeked'' data. For instance, if the peeked data is of type GTK_PARAM_POINTER, then DATA will be a pointer to a pointer. If the value stack is empty or does not exist or an error occurs, gtk_object_peek_value will return FALSE. On success it will return TRUE.

Signals Overview
****************

Signals are GTK's method for objects to perform callbacks. A signal is an event which occurs upon an object. The programmer can connect to a signal of an object which involves specifying a function to be called when that signal is emitted in the specified object.

When a signal is emitted, both the class function associated with the signal (when it was defined) and all signal handlers installed for that signal on the particular object emitting the signal are called. The widget programmer can specify whether the class function is to be called before after or both before and after the signal handlers installed by the widget user. The widget user can, however, specify that their signal handler is to be run after the class function (using the ``_after'' signal connection routines). Any signal handling function can emit the same signal on the same object while it is running causing that signal emission to either restart or to run recursively. Additionally, signal emission can be terminated prematurely. While both such abilities are rarely used, they do allow for greater flexibility in regards to signals. For instance, a programmer can attach to the key press event signal and intercept all tab key presses from a widget. This particular example is used in the file selection dialog to implement tab completion of filenames and prevent the entry widget from inserting the tab into its buffer.

Signals are selected using either an integer identifier or a character string name. It is convention to name the signal the same as the class function which is associated with it. There are two versions of most of the signal functions, one which takes an integer identifier and one which takes a character string name for the signal.

 -- Function: gint gtk_signal_new (gchar *NAME, GtkSignalRunType RUN_TYPE, gint OBJECT_TYPE, gint FUNCTION_OFFSET, GtkSignalMarshaller MARSHALLER, GtkParamType RETURN_VAL, gint NPARAMS, ...)
     Create a new signal and give it the character string identifier NAME. NAME needs to be unique in the context of OBJECT_TYPE's branch of the class hierarchy. That is, OBJECT_TYPE cannot create a signal type with the same name as a signal type created by one of its parent types.

     RUN_TYPE specifies whether the class function should be run before (GTK_RUN_FIRST), after (GTK_RUN_LAST) or both before and after normal signal handlers (GTK_RUN_BOTH). Additionally, the GTK_RUN_NO_RECURSE value can be or'ed with any of those values to specify that the signal should not be recursive. By default, emitting the same signal on the same widget will cause the signal to be emitted twice. However, if the GTK_RUN_NO_RECURSE flag is specified, emitting the same signal on the same widget will cause the current signal emission to be restarted. This allows the widget programmer to specify the semantics of signal emission on a per signal basis. (The GTK_RUN_NO_RECURSE flag is used by the GtkAdjustment widget).

     The FUNCTION_OFFSET is the byte offset from the start of the class structure to the class function field within the class structure. The easiest means to compute this offset is by using the GTK_SIGNAL_OFFSET macro which takes the class structure type as the first argument and the field as the second argument. For example, GTK_SIGNAL_OFFSET (GtkObjectClass, destroy) will give the offset of the destroy class function within the GtkObjectClass. Note: An offset is specified instead of an absolute location since there will be multiple instances of a class structure being referenced. (The GtkWidgetClass structure ``is a'' GtkObjectClass structure, etc.)

     The MARSHALLER function is used to invoke a signal handler. Since signal handlers may take different parameters and return values and a general mechanism for invoking them is not apparent, the approach of making the signal creator responsible for invoking the signal handler was taken. (FIXME: unfinished).

     The RETURN_VAL and NPARAMS and the remaining arguments specify the return value and the arguments to the signal handler respectively. Note: There is an implicit first argument to every signal handler which is the widget the signal has been emitted from. The variable argument list (...) specifies the types of the arguments. These can be one of GTK_PARAM_CHAR, GTK_PARAM_SHORT, GTK_PARAM_INT, GTK_PARAM_LONG, GTK_PARAM_POINTER or GTK_PARAM_FUNCTION. It is undefined to specify GTK_PARAM_NONE as an argument type, however it is OK to use GTK_PARAM_NONE for RETURN_VAL. (This corresponds to returning a void).

     gtk_signal_new returns the integer identifier of the newly created signal. Signal identifiers start numbering at 1 and increase upwards. A value of -1 will be returned if an error occurs.

     Note: gtk_signal_new is only needed by widget writers. A normal user of GTK will never needed to invoke this function.

 -- Function: gint gtk_signal_lookup (gchar *NAME, gint OBJECT_TYPE)
     Returns the integer identifier for the signal referenced by NAME and OBJECT_TYPE. If OBJECT_TYPE does not define the signal NAME, then the signal is looked for in OBJECT_TYPE's parent type recursively.

 -- Function: gchar* gtk_signal_name (gint SIGNAL_NUM)

 -- Function: gint gtk_signal_emit (GtkObject *OBJECT, gint SIGNAL_TYPE, ...)
     Emit the signal specified by the integer identifier SIGNAL_TYPE from OBJECT. If an error occurs, gtk_signal_emit will return FALSE and will return TRUE on success. The signal definition determines the parameters passed in the variable argument list (...). For example, if the signal is defined as:

            gint (* event) (GtkWidget *widget, GdkEvent *event);

     Then a call to emit the ``event'' signal would look like:

            GdkEvent event;
            gint return_val;
            ...
            gtk_signal_emit (some_object,
                             gtk_signal_lookup ("event",
                               GTK_OBJECT_TYPE (some_object)),
                             &event, &return_val);

     Notice that the widget argument is implicit in that the first argument to every signal is a type derived from GtkObject. The RETURN_VAL argument is actually a pointer to the return value type since the signal mechanism needs to be able to place the return value in an actual location. And lastly, the gtk_signal_lookup call is normally avoided by using the gtk_signal_emit_by_name function instead. gtk_signal_emit is normally used internally by widgets which know the signal identifier (since they defined the signal) and can therefore side-step the cost of calling gtk_signal_lookup.

 -- Function: gint gtk_signal_emit_by_name (GtkObject *OBJECT, gchar *NAME, ...)
     Similar to gtk_signal_emit except that the signal is referenced by NAME instead of by its integer identifier.

 -- Function: void gtk_signal_emit_stop (GtkObject *OBJECT, gint SIGNAL_TYPE)
     Stop the emission of the signal SIGNAL_TYPE on OBJECT. SIGNAL_TYPE is the integer identifier for the signal and can be determined using the function gtk_signal_lookup. Alternatively, the function gtk_signal_emit_stop_by_name can be used to refer to the signal by name. Attempting to stop the emission of a signal that isn't being emitted does nothing.

 -- Function: void gtk_signal_emit_stop_by_name (GtkObject *OBJECT, gchar *NAME)
     Similar to gtk_signal_emit_stop except that the signal is referenced by NAME instead of by its integer identifier.

 -- Function: gint gtk_signal_connect (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, gpointer FUNC_DATA)
     Connects a signal handling function to a signal emitting object. FUNC is connected to the signal NAME emitted by OBJECT. The arguments and returns type of FUNC should match the arguments and return type of the signal NAME. However, FUNC may take the extra argument of FUNC_DATA. Due to the C calling convention it is OK to ignore the extra argument. (It is OK to ignore all the arguments in fact).

     gtk_signal_connect returns an integer identifier for the connection which can be used to refer to it in the future. Specifically it is useful for removing the connection and/or blocking it from being used.

 -- Function: gint gtk_signal_connect_after (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, gpointer FUNC_DATA)
     Similar to gtk_signal_connect except the signal handler is connected in the ``after'' slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal.

     Like gtk_signal_connect, gtk_signal_connect_after returns an integer identifier which can be used to refer to the connection.

 -- Function: gint gtk_signal_connect_object (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, GtkObject *SLOT_OBJECT)
     Connects FUNC to the signal NAME emitted by OBJECT. Similar to gtk_signal_connect with the difference that SLOT_OBJECT is passed as the first parameter to FUNC instead of the signal emitting object. This can be useful for connecting a signal emitted by one object to a signal in another object. A common usage is to connect the ``destroy'' signal of dialog to the ``clicked'' signal emitted by a ``close'' button in the dialog. That is, the ``clicked'' signal emitted by the button will caused the ``destroy'' signal to be emitted for the dialog. This is also the ``right'' way to handle closing of a dialog since the ``destroy'' signal will be sent if the dialog is deleted using a window manager function and this enables the two methods of closing the window to be handled by the same mechanism. Returns an integer identifier which can be used to refer to the connection.

 -- Function: gint gtk_signal_connect_object_after (GtkObject *OBJECT, gchar *NAME, GtkSignalFunc FUNC, GtkObject *SLOT_OBJECT)
     Similar to gtk_signal_connect_object except the signal handler is connected in the ``after'' slot. This allows a signal handler to be guaranteed to run after other signal handlers connected to the same signal on the same object and after the class function associated with the signal. Returns an integer identifier which can be used to refer to the connection.

 -- Function: gint gtk_signal_connect_interp (GtkObject *OBJECT, gchar *NAME, GtkCallbackMarshal FUNC, gpointer DATA, GtkDestroyNotify DESTROY_FUNC, gint AFTER)

 -- Function: void gtk_signal_disconnect (GtkObject *OBJECT, gint ID)
     Disconnects a signal handler from an object. The signal handler is identified by the integer ID which is returned by the gtk_signal_connect* family of functions.

 -- Function: void gtk_signal_disconnect_by_data (GtkObject *OBJECT, gpointer DATA)
     Disconnects a signal handler from an object. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the gtk_signal_connect* family of functions. For the gtk_signal_connect_object* functions, DATA refers to the SLOT_OBJECT.

     Note: This will remove all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be disconnected with this call.

 -- Function: void gtk_signal_handler_block (GtkObject *OBJECT, gint ID)
     Blocks calling of a signal handler during signal emission. The signal handler is identified by the integer ID which is returned by the gtk_signal_connect* family of functions. If the signal is already blocked no change is made.

 -- Function: void gtk_signal_handler_block_by_data (GtkObject *OBJECT, gint DATA)
     Blocks calling of a signal handler during signal emission. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the gtk_signal_connect* family of functions. For the gtk_signal_connect_object* functions, DATA refers to the SLOT_OBJECT. If the signal is already blocked no change is made.

     Note: This will block all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be blocked with this call.

 -- Function: void gtk_signal_handler_unblock (GtkObject *OBJECT, gint ID)
     Unblocks calling of a signal handler during signal emission. The signal handler is identified by the integer ID which is returned by the gtk_signal_connect* family of functions. If the signal is already unblocked no change is made.

 -- Function: void gtk_signal_handler_unblock_by_data (GtkObject *OBJECT, gint DATA)
     Unblocks calling of a signal handler during signal emission. The signal handler is identified by the DATA argument specified as the FUNC_DATA argument to the gtk_signal_connect* family of functions. For the gtk_signal_connect_object* functions, DATA refers to the SLOT_OBJECT. If the signal is already unblocked no change is made.

     Note: This will unblock all signal handlers connected to OBJECT which were connected using DATA as their FUNC_DATA argument. Multiple signal handlers may be unblocked with this call.

 -- Function: void gtk_signal_handlers_destroy (GtkObject *OBJECT)
     Destroy all of the signal handlers connected to OBJECT. There should normally never be reason to call this function as it is called automatically when OBJECT is destroyed.

 -- Function: void gtk_signal_default_marshaller (GtkObject *OBJECT, GtkSignalFunc FUNC, gpointer FUNC_DATA, GtkSignalParam *PARAMS)
     gtk_signal_new requires a callback in order to actually call a signal handler for a particular signal. The vast majority of signals are of the particular form:

            (* std_signal) (gpointer std_arg);

     gtk_signal_default_marshaller is a signal marshaller which marshals arguments for a signal of that form.

 -- Function: void gtk_signal_set_funcs (GtkSignalMarshal MARSHAL_FUNC, GtkSignalDestroy DESTROY_FUN)

Widget Overview
***************

Widgets are the general term used to describe user interface objects. A widget defines a class interface that all user interface objects conform to. This interface allows a uniform method for dealing with operations common to all objects such as hiding and showing, size requisition and allocation and events.

The common interface that widgets must adhere to is described by the GtkWidget and GtkWidgetClass structure. For the purposes of using GTK these structures can be considered read-only and, for the most part, opaque.

All widget creation routines in GTK return pointers to GtkWidget structures. In reality, all widget creation routines create structures that can be viewed as equivalent to the GtkWidget structure, but often have contain additional information. See Object Implementation

The widgets available for use are implemented in a hierarchy. Several widgets exist solely as common bases for more specific widgets. For example, it is not possible to create a ruler widget itself, but the ruler widget provides a base and functionality common to the horizontal and vertical rulers.

The available widgets (in alphabetical order):

The alignment widget
====================

Description
-----------

The alignment widget is a container (see GtkContainer) derived from the bin widget (see GtkBin). Its entire purpose is to give the programmer flexibility in how the child it manages is positioned when a window is resized.

Normally, a widget is allocated at least as much size as it requests. (see GtkContainer for a discussion of geometry management). When a widget is allocated more size than it requests there is a question of how the widget should expand. By convention, most GTK widgets expand to fill their allocated space. Sometimes this behavior is not desired. The alignment widget allows the programmer to specify how a widget should expand and position itself to fill the area it is allocated.

Options
-------

 -- User Option: xscale
 -- User Option: yscale
     The XSCALE and YSCALE options specify how to scale the child widget. If the scale value is 0.0, the child widget is allocated exactly the size it requested in that dimension. If the scale value is 1.0, the child widget is allocated all of the space in a dimension. A scale value of 1.0 for both x and y is equivalent to not using an alignment widget.

 -- User Option: xalign
 -- User Option: yalign
     The XALIGN and YALIGN options specify how to position the child widget when it is not allocated all the space available to it (because the XSCALE and/or YSCALE options are less than 1.0). If an alignment value is 0.0 the widget is positioned to the left (or top) of its allocated space. An alignment value of 1.0 positions the widget to the right (or bottom) of its allocated space. A common usage is to specify XALIGN and YALIGN to be 0.5 which causes the widget to be centered within its allocated area.

Signals
-------

Functions
---------

 -- Function: guint gtk_alignment_get_type (void)
     Returns the GtkAlignment type identifier.

 -- Function: GtkWidget* gtk_alignment_new (gfloat XALIGN, gfloat YALIGN, gfloat XSCALE, gfloat YSCALE)
     Create a new GtkAlignment object and initialize it with the values XALIGN, YALIGN, XSCALE and YSCALE. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_alignment_set (GtkAlignment *ALIGNMENT, gfloat XALIGN, gfloat YALIGN, gfloat XSCALE, gfloat YSCALE)
     Set the XALIGN, YALIGN, XSCALE and YSCALE options of an alignment widget. It is important to not set the fields of the GtkAlignment structure directly (or, for that matter, any type derived from GtkObject).

Alignment, ALIGNMENT

The arrow widget
================

Description
-----------

The arrow widget is derived from the misc widget (see GtkMisc) and is intended for use where a directional arrow (in one of the four cardinal directions) is desired. As such, it has very limited functionality and basically only draws itself in a particular direction and with a particular shadow type. The arrow widget will expand to fill all the space it is allocated.

Options
-------

 -- User Option: arrow_type
     The ARROW_TYPE option specifies which direction the arrow will point. It can be one of GTK_ARROW_UP, GTK_ARROW_DOWN, GTK_ARROW_LEFT or GTK_ARROW_RIGHT. This will set the arrow pointing in the direction specified.

 -- User Option: shadow_type
     The SHADOW_TYPE option specifies how to draw the shadow for the arrow. Currently, only the GTK_SHADOW_IN and GTK_SHADOW_OUT shadow types are supported for drawing arrows. Other shadow types will cause nothing to be drawn.

Signals
-------

Functions
---------

 -- Function: guint gtk_arrow_get_type (void)
     Returns the GtkArrow type identifier.

 -- Function: GtkWidget* gtk_arrow_new (GtkArrowType ARROW_TYPE, GtkShadowType SHADOW_TYPE)
     Create a new GtkArrow object and initialize it with the values ARROW_TYPE and SHADOW_TYPE. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_arrow_set (GtkArrow *ARROW, GtkArrowType ARROW_TYPE, GtkShadowType SHADOW_TYPE)
     Set the ARROW_TYPE and SHADOW_TYPE options of an arrow widget. It is important to not set the fields of the GtkArrow structure directly (or, for that matter, any type derived from GtkObject).

Arrow, ARROW

The aspect frame widget
=======================

Description
-----------

Ensure that the child window has a specified aspect ratio or, if obey_child, has the same aspect ratio as its requested size.  Derived from see GtkFrame).

Options
-------

 -- User Option: label

 -- User Option: xalign

 -- User Option: yalign

 -- User Option: ratio

 -- User Option: obey_child

Signals
-------

Functions
---------

 -- Function: guint gtk_aspect_frame_get_type (void)
     Returns the GtkAspectFrame type identifier.

 -- Function: GtkWidget* gtk_aspect_frame_new (gchar *LABEL, gfloat XALIGN, gfloat YALIGN, gfloat RATIO, gint OBEY_CHILD)
     Create a new GtkAspectFrame object and initialize it with the values LABEL, XALIGN, YALIGN, RATIO and OBEY_CHILD. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_aspect_frame_set (GtkAspectFrame *ASPECT_FRAME, gfloat XALIGN, gfloat YALIGN, gfloat RATIO, gint OBEY_CHILD)

AspectFrame, ASPECT_FRAME

The bin widget
==============

Description
-----------

The bin widget is a container (see GtkContainer) derived from the container widget. It is an abstract base class. That is, it is not possible to create an actual bin widget. It exists only to provide a base of functionality for other widgets. Specifically, the bin widget provides a base for several other widgets that contain only a single child. These widgets include alignments (see GtkAlignment), frames (see GtkFrame), items (see GtkItem), viewports (see GtkViewport) and windows (see GtkWindow)

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_bin_get_type (void)
     Returns the GtkBin type identifier.

Bin, BIN

The box widget
==============

Description
-----------

The box widget is a container (see GtkContainer) derived from the container widget. It is an abstract base class used by the horizontal box (see GtkHBox), the vertical box (see GtkVBox) and the (see GtkButtonBox) widgets to provide a base of common functionality.

A box provides an abstraction for organizing the position and size of widgets. Widgets in a box are laid out horizontally or vertically. By using a box widget appropriately, a programmer can control how widgets are positioned and how they will be allocated space when a window gets resized.

The key attribute of boxes is that they position their children in a single row (horizontal boxes) or column (vertical boxes). In the case of horizontal boxes, all children are stretched vertically. The vertical size of the box is determined by the largest vertical requisition of all of its children. Similarly, a vertical box stretches all of its children horizontally. The horizontal size (of the vertical box) is determined by the largest horizontal requisition of all of its children. An alignment widget (see GtkAlignment) can be used to control child allocation more precisely on a per child basis.

The second attribute of boxes is how they expand children. In the case of a horizontal box, the main control is over how children are expanded horizontally to fill the allocated area. (The rest of this discussion will focus on horizontal boxes but it applies to vertical boxes as well).

There are two flags which can be set controlling how a widget is expanded horizontally in a horizontal box. These are the expand and fill. There operation is fairly simple. If expand is set, the child's potentially allocated area will expand to fill available space. If fill is set, the child's actual allocated area will be its potentially allocated area. There is a difference between the potentially area (which is the area the box widget sets aside for the child) and the actual allocated area (which is the area the box widget actual allocates for the widget via gtk_widget_size_allocate).

The allocation of space to children occurs as follows (for horizontal boxes):

 1. All children are allocated at least their requested size horizontally and the maximum requested child size vertically.

 2. Any child with the expand flag set is allocated extra_width / nexpand_children extra pixels horizontally. If the homogeneous flag was set, all children are considered to have the expand flag set. That is, all children will be allocated the same area.The horizontal box is a fair widget and, as such, divides up any extra allocated space evenly among the ``expand'' children. (Those children which have the expand flag set). The exception occurs when extra_width / nexpand_children does not divide cleanly. The extra space is given to the last widget.

 3. spacing number of pixels separate each child. Note: The separation is between the potentially allocated area for each child and not the actual allocated area. The padding value associated with each child causes that many pixels to be left empty to each side of the child.

 4. If a child has the fill flag set it is allocated its potentially allocated area. If it does not, it is allocated its requested size horizontally and centered within its potentially allocated area. Its vertical allocation is still the maximum requested size of any child.

 5. Children placed at the start of the box are placed in order of addition to the box from left to right in the boxes allocated area.. Children placed at the end of the box are placed in order of addition from right to left in the boxes allocated area.

See GtkHBox, and GtkVBox, for code examples of using horizontal and vertical boxes.

Options
-------

 -- User Option: expand

 -- User Option: fill

 -- User Option: padding

 -- User Option: expand

Signals
-------

Functions
---------

 -- Function: guint gtk_box_get_type (void)
     Returns the GtkBox type identifier.

 -- Function: void gtk_box_pack_start (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING)
     Add CHILD to the front of BOX. The flags EXPAND and FILL and the padding value of PADDING are associated with CHILD.

 -- Function: void gtk_box_pack_end (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING)
     Add CHILD to the end of BOX. The flags EXPAND and FILL and the padding value of PADDING are associated with CHILD.

 -- Function: void gtk_box_pack_start_defaults (GtkBox *BOX, GtkWidget *WIDGET)
     A convenience function which is equivalent to the following:

            gtk_box_pack_start (BOX, WIDGET, TRUE, TRUE, 0);

 -- Function: void gtk_box_pack_end_defaults (GtkBox *BOX, GtkWidget *WIDGET)
     A convenience function which is equivalent to the following:

            gtk_box_pack_start (BOX, WIDGET, TRUE, TRUE, 0);

 -- Function: void gtk_box_set_homogeneous (GtkBox *BOX, gint HOMOGENEOUS)
     Set the homogeneous setting of this box to HOMOGENEOUS.

 -- Function: void gtk_box_set_spacing (GtkBox *BOX, gint SPACING)

 -- Function: void gtk_box_reorder_child (GtkBox *BOX, GtkWidget *CHILD, guint POS)

 -- Function: void gtk_box_query_child_packing (GtkBox *BOX, GtkWidget *CHILD, gint *EXPAND, gint *FILL, gint *PADDING, GtkPackType *PACK_TYPE)

 -- Function: void gtk_box_set_child_packing (GtkBox *BOX, GtkWidget *CHILD, gint EXPAND, gint FILL, gint PADDING, GtkPackType *PACK_TYPE)

Box, BOX

The button box widget
=====================

Description
-----------

The button box widget is a container (see GtkContainer) derived from the (see GtkBox) widget. It is an abstract base class used by the horizontal button box (see GtkHButtonBox) and the vertical button box (see GtkVButtonBox) widgets to provide a base of common functionality.

The button box, like the box widget, (see GtkBox) provides an abstraction for organizing position and size of widgets. In the case of the button box it is targeted at the button widget,(see GtkButton). Button widgets are laid out in the box horizontally or vertically. By using a button box widget appropriately, a programmer can control how the button widgets are positioned and how they will be allocated space when a window gets resized.

Options
-------

 -- User Option: layout_style

            * GTK_BUTTONBOX_SPREAD

       * The layout style GTK_BUTTONBOX_SPREAD will spread the buttons out evenly within the button box. When the parent window is resized they will re-adjust to the new window dimensions. The gtk_button_box_set_spacing function will set the minimum space that the buttons will leave between themselves.

            * GTK_BUTTONBOX_EDGE

            * GTK_BUTTONBOX_START

       * The layout style GTK_BUTTONBOX_START will place the buttons at the start of the button box, taking into account the spacing as set by the gtk_button_box_set_spacing function. The buttons will not move when the parent window is re-sized.

            * GTK_BUTTONBOX_END

       * The layout style GTK_BUTTONBOX_END will place the buttons at the end of the button box, taking into account the spacing as set by the gtk_button_box_set_spacing function. Again like the GTK_BUTTONBOX_START layout style the buttons will not move when the parent window is re-sized.

 -- User Option: width

 -- User Option: height

 -- User Option: ipad_x
 -- User Option: ipad_y

Signals
-------

Functions
---------

 -- Function: guint gtk_button_box_get_type (void)
     Returns the GtkButtonBox type identifier.

 -- Function: void gtk_button_box_set_child_size_default (gint WIDTH, gintHEIGHT)

 -- Function: void gtk_button_box_set_child_ipadding_default (gint IPAD_X, gint IPAD_Y)

 -- Function: void gtk_button_box_get_child_size_default (gint *WIDTH, gint *HEIGHT)

 -- Function: void gtk_button_box_get_child_ipadding_default (gint *IPAD_X, gint *IPAD_Y)

 -- Function: void gtk_button_box_set_child_size (GtkButtonBox *WIDGET, gint WIDTH, gint HEIGHT)

 -- Function: void gtk_button_box_set_child_ipadding (GtkButtonBox *WIDGET, gint IPAD_X, gint IPAD_Y)

 -- Function: void gtk_button_box_set_layout (GtkButtonBox *WIDGET, gint LAYOUT_STYLE)
     This will set the layout style of the buttons within this box. Currently it can be set to one of GTK_BUTTONBOX_SPREAD, GTK_BUTTONBOX_EDGE, GTK_BUTTONBOX_START or GTK_BUTTONBOX_END.

     The following example:

              gtk_button_box_set_layout (GTK_BUTTON_BOX (box),
                                         GTK_BUTTONBOX_SPREAD);

     Will set the BOX argument to the SPREAD layout style described above.

 -- Function: gint gtk_button_box_get_spacing (GtkButtonBox *WIDGET)
     Get the per widget value for spacing within the button box. This value is the amount of space that will be between the individual buttons contained by this box.

 -- Function: void gtk_button_box_get_child_size (GtkButtonBox *WIDGET, gint *WIDTH, gint *HEIGHT)

 -- Function: void gtk_button_box_get_child_ipadding (GtkButtonBox *WIDGET, gint *IPAD_X, gint *IPAD_Y)
     Get the per widget value for the padding inside the buttons. This value controls how large the buttons will be within the box.

 -- Function: gint gtk_button_box_get_layout (GtkButtonBox *WIDGET)
     Get the LAYOUT_STYLE for the GtkButtonBox object passed to this function in the WIDGET variable.

             layout = gtk_button_box_get_layout(GTK_BUTTON_BOX (box));

ButtonBox, BUTTON_BOX

The button widget
=================

Description
-----------

A pressable button.  Contains a widget.  Changes its appearance (hilites) when it gets the focus.  Changes its appearance (pressed) when activated.  Derived from see GtkContainer.

Signals
-------

 -- Signal: void GtkButton::pressed (GtkButton *BUTTON)

 -- Signal: void GtkButton::released (GtkButton *BUTTON)

 -- Signal: void GtkButton::clicked (GtkButton *BUTTON)

 -- Signal: void GtkButton::enter (GtkButton *BUTTON)

 -- Signal: void GtkButton::leave (GtkButton *BUTTON)

Functions
---------

 -- Function: guint gtk_button_get_type (void)
     Returns the GtkButton type identifier.

 -- Function: GtkWidget* gtk_button_new (void)
     Create a new GtkButton object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_button_new_with_label (gchar *LABEL)
     Create a new GtkButton object and set the text that is on the button to LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_button_pressed (GtkButton *BUTTON)

 -- Function: void gtk_button_released (GtkButton *BUTTON)

 -- Function: void gtk_button_clicked (GtkButton *BUTTON)

 -- Function: void gtk_button_enter (GtkButton *BUTTON)

 -- Function: void gtk_button_leave (GtkButton *BUTTON)

Button, BUTTON

The check button widget
=======================

Description
-----------

Another form of toggle button (see GtkToggleButton) with an indicator.  Contains a widget to the right of the indicator.  Changes its appearance (hilites) when it gets the focus.

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_check_button_get_type (void)
     Returns the GtkCheckButton type identifier.

 -- Function: GtkWidget* gtk_check_button_new (void)
     Create a new GtkCheckButton object and initialize it with the default values in the library. The new widget is returned as a pointer to a GtkWidget object. A NULL is returned on failure.

 -- Function: GtkWidget* gtk_check_button_new_with_label (gchar *LABEL)
     Create a new GtkCheckButton object and initialize it with the values LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on any failure.

 -- Function: GtkCheckButton* GTK_CHECK_BUTTON (gpointer OBJ)

 -- Function: GtkCheckButtonClass* GTK_CHECK_BUTTON_CLASS (gpointer CLASS)

 -- Function: gint GTK_IS_CHECK_BUTTON (gpointer OBJ)

CheckButton, CHECK_BUTTON

The check menu item widget
==========================

Description
-----------

Derived from see GtkMenuItem.  Very similar to a checkbutton (see GtkCheckButton), except that it's a menu item.  Has a toggled state which is displayed in a small rectangle to the left of the contained widget.

Options
-------

 -- User Option: label

 -- User Option: state

Signals
-------

 -- Signal: void GtkCheckMenuItem::toggled (GtkCheckMenuItem *CHECK_MENU_ITEM)

Functions
---------

 -- Function: guint gtk_check_menu_item_get_type (void)
     Returns the GtkCheckMenuItem type identifier.

 -- Function: GtkWidget* gtk_check_menu_item_new (void)
     Create a new GtkCheckMenuItem object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_check_menu_item_new_with_label (gchar *LABEL)
     Create a new GtkCheckMenuItem object and initialize it with the values LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_check_menu_item_set_state (GtkCheckMenuItem *CHECK_MENU_ITEM, gint STATE)

 -- Function: void gtk_check_menu_item_toggled (GtkCheckMenuItem *CHECK_MENU_ITEM)

CheckMenuItem, CHECK_MENU_ITEM

The compound list widget
========================

Description
-----------

A list of rows of columns, with a title row.  You can insert rows, and delete rows.  The user can scroll around and select a row.  Derived from see GtkContainer.  Cells can be empty, have a text and/or pixmap, or be a widget.

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_clist_get_type (void)
     Returns the GtkCList type identifier.

 -- Function: GtkWidget* gtk_clist_new (int COLUMNS)
     Create a new GtkCList initializing it with the value COLUMNS. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_clist_new_with_titles (int COLUMNS, gchar *TITLES[])

 -- Function: void gtk_clist_set_border (GtkCList *CLIST, GtkShadowType BORDER)
     Set the border style of the CLIST to the shadow type BORDER.

 -- Function: void gtk_clist_set_selection_mode (GtkCList *CLIST GtkSelectionMode MODE)
     Set the selection mode on the CLIST to the MODE selection mode.

 -- Function: void gtk_clist_set_policy (GtkCList *CLIST, GtkPolicyType VSCROLLBAR_POLICY, GtkPolicyType HSCROLLBAR_POLICY)
     Set the policy on the scrollbars on the CLIST to VSCROLLBAR_POLICY and HSCROLLBAR_POLICY.

 -- Function: void gtk_clist_freeze (GtkCList *CLIST)
     Stop all visual updates of the CLIST. Useful for when making a large number of changes to a GtkCList.

 -- Function: void gtk_clist_thaw (GtkCList *CLIST)
     Allow all visual updates of the CLIST to resume.

 -- Function: void gtk_clist_column_titles_show (GtkCList *CLIST)
     Show the column title buttons on the CLIST.

 -- Function: void gtk_clist_column_titles_hide (GtkCList *CLIST)
     Hide the column title buttons on the CLIST.

 -- Function: void gtk_clist_set_column_title (GtkCList *CLIST, gint COLUMN, gchar *TITLE)
     Set the title in column COLUMN of the CLIST button to TITLE.

 -- Function: void gtk_clist_set_column_widget (GtkCList *CLIST, gint COLUMN, GtkWidget *WIDGET)
     Set the WIDGET instead of the title button for the column COLUMN in the CLIST.

 -- Function: void gtk_clist_set_column_justification (GtkCList *CLIST, gint COLUMN, GtkJustification JUSTIFICATION)
     Set the COLUMN's justification, in the CLIST to JUSTIFICATION.

 -- Function: void gtk_clist_set_column_width (GtkCList *CLIST, gint COLUMN, gint WIDTH)
     Set the pixel width of column COLUMN in the GtkCList CLIST to WIDTH. This function is a necessary step in creating a GtkCList because otherwise the column width is chosen from the width of the column title, which is almost never correct.

 -- Function: void gtk_clist_set_row_height (GtkCList *CLIST, gint HEIGHT)
     Change the height of the rows in the CLIST to HEIGHT. The default is the height of the current font.

 -- Function: void gtk_clist_moveto (GtkCList *CLIST, gint ROW, gintCOLUMN, gfloat ROW_ALIGN, gfloat COL_ALIGN)
     Scroll the viewing area of the GtkClist in CLIST to COLUMN and ROW. The ROW_ALIGN and COL_ALIGN are between zero and one, representing the location the row should appear on screen. Setting ROW_ALIGN or the COL_ALIGN to 0.0 will be the top or left of the viewing area. Setting the ROW_ALIGN or COL_ALIGN to 1.0 will be the bottom or right of the viewing area. If the ROW or COLUMN is -1 then there is no change.

 -- Function: void gtk_clist_set_text (GtkCList *CLIST, gint ROW, gint COLUMN, gchar *TEXT)
     Set a given cell's text, located by the ROW and COLUMN, to TEXT replacing its current contents.

 -- Function: void gtk_clist_set_pixmap (GtkCList *CLIST, gint ROW, gint COLUMN, GdkPixmap *PIXMAP, GdkBitmap *MASK)
     Set a given cell's text, located by the COLUMN and ROW arguments, to the pixmap described by the PIXMAP argument using the MASK as its mask. The current contents of the cell will be replaced.

 -- Function: void gtk_clist_setpixtext (GtkCList *CLIST, gint ROW, gint COLUMN, gchar *TEXT, guint8 SPACING, GdkPixmap *PIXMAP, GdkBitmap *MASK)
     Set a given cell's text and pixmap, located by the ROW and COLUMN arguments, to the text and pixmap described by the PIXMAP and TEXT arguments. The MASK will be used for the pixmap mask and the SPACING argument specifies the spacing between the two.

 -- Function: void gtk_clist_set_foreground (GtkCList *CLIST, gint ROW, GdkColor *COLOR)
     Set the foreground color of row ROW to COLOR in the GtkCList CLIST. The COLOR must already be allocated.

 -- Function: void gtk_clist_set_background (GtkCList *CLIST, gint ROW, GdkColor *COLOR)
     Set the background color of row ROW to COLOR in the GtkCList pointed to by CLIST. The color must be previously allocated.

 -- Function: void gtk_clist_set_shift (GtkCList *CLIST, gint ROW, gint COLUMN, gint VERTICAL, gint HORIZONTAL)
     Set the horizontal and vertical shift for drawing the contents of the cell located at ROW and COLUMN. The VERTICAL and HORIZONTAL arguments can be positive or negative.

 -- Function: gint gtk_clist_append (GtkCList *CLIST, gchar *TEXT[])
     Append the given text, in the TEXT[] argument,  to the GtkCList pointed to by the CLIST. The return value is the index of the row that was just added.

 -- Function: void gtk_clist_insert (GtkCList *CLIST, gint ROW, gchar *TEXT[])
     Insert a row into the GtkCList pointed to by CLIST at row ROW with the text in TEXT[].

 -- Function: void gtk_clist_remove (GtkCList *CLIST, gint ROW)
     Remove row index ROW from the CLIST.

 -- Function: void gtk_clist_set_row_data (GtkCList *CLIST, gint ROW, gpointer DATA)
     Will set an arbitrary data pointer, DATA, for row ROW in the GtkCList pointed to by CLIST.

 -- Function: gpointer gtk_clist_get_row_data (GtkCList *CLIST, gint ROW)
     Return the data that was set for row ROW from the GtkCList pointed to by CLIST. NULL is returned if no data was set.

 -- Function: void gtk_clist_select_row (GtkCList *CLIST, gint ROW, gint COLUMN)
     Force selection of a row, located by ROW and COLUMN, in the GtkCList pointed to by CLIST.

 -- Function: void gtk_clist_unselect_row (GtkCList *CLIST, gint ROW, gint COLUMN)
     Force the unselection of a row, located by ROW and COLUMN, in the GtkCList pointed to by CLIST.

 -- Function: void gtk_clist_clear (GtkCList *CLIST)
     Clear the entire contents of the GtkCList pointed to by CLIST. This is much faster then removing each item separately with gtk_clist_remove.

CList, CLIST

The color selector widget
=========================

Description
-----------

A widget that allows a user to pick a color in one of many ways.  They can click on a color wheel or saturation bar.  They can change hue, saturation, value, red, green, or blue with a slider, or by entering values.  Also allows the user to set an alpha (opacity) value.  Derived from see GtkVBox.

Options
-------

 -- User Option: policy

       * GTK_UPDATE_CONTINUOUS

       * GTK_UPDATE_DISCONTINUOUS

       * GTK_UPDATE_DELAYED

 -- User Option: color

 -- User Option: use_opacity

 -- User Option: title

Signals
-------

Functions
---------

 -- Function: guint gtk_color_selection_get_type (void)
     Returns the GtkColorSelection type identifier.

 -- Function: GtkWidget* gtk_color_selection_new (void)
     Create a new GtkColorSelection object. The new object is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_color_selection_set_update_policy (GtkColorSelection *COLORSEL, GtkUpdateType POLICY)

 -- Function: void gtk_color_selection_set_color (GtkColorSelection *COLORSEL, gdouble *COLOR)

 -- Function: void gtk_color_selection_get_color (GtkColorSelection *COLORSEL, gdouble *COLOR)

 -- Function: void gtk_color_selection_set_opacity (GtkColorSelection *COLORSEL, gint USE_OPACITY)

 -- Function: guint gtk_color_selection_dialog_get_type (void)
     Returns the GtkColorSelection type identifier.

 -- Function: GtkWidget* gtk_color_selection_dialog_new (gchar *TITLE)
     Create a new GtkColorSelection object initializing the title bar of the resulting dialog to TITLE. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

ColorSelection, COLOR_SELECTION

The combo widget
================

Description
-----------

Text input box which also lets you choose from pre-defined values from a drop-down menu.  Derived from see GtkHBox.

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_combo_get_type (void)
     Returns the GtkCombo type identifier.

 -- Function: GtkWidget* gtk_combo_new (void)
     Create a new GtkCombo object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_combo_set_value_in_list (GtkCombo *COMBO, gint VAL, gint OK_IF_EMPTY)

 -- Function: void gtk_combo_set_use_arrows (GtkCombo *COMBO, gint VAL)

 -- Function: void gtk_combo_set_use_arrows_always (GtkCombo *COMBO, gint VAL)

 -- Function: void gtk_combo_set_case_sensitive (GtkCombo *COMBO, gint VAL)

 -- Function: void gtk_combo_set_item_string (GtkCombo *COMBO, GtkItem *ITEM, gchar *ITEM_VALUE)

 -- Function: void gtk_combo_set_popdown_strings (GtkCombo *COMBO, GList *STRINGS)

Combo, COMBO

The container widget
====================

Description
-----------

A base class for objects that are built out of other widgets.  Many widgets are containers.  For example, a button contains a widget.  That widget might be a text label (usually is), or a pixmap, or even an hbox which has a label and a pixmap.

Options
-------

 -- User Option: border_width

Signals
-------

 -- Signal: void GtkContainer::add (GtkContainer *CONTAINER, GtkWidget *WIDGET)

 -- Signal: void GtkContainer::remove (GtkContainer *CONTAINER, GtkWidget *WIDGET)

 -- Signal: void GtkContainer::need_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET)

 -- Signal: void GtkContainer::foreach (GtkContainer *CONTAINER, GtkCallback CALLBACK, gpointer CALLBACK_DATA)

 -- Signal: gint GtkContainer::focus (GtkContainer *CONTAINER, GtkDirectionType DIRECTION)

Functions
---------

 -- Function: guint gtk_container_get_type (void)
     Returns the GtkContainer type identifier.

 -- Function: void gtk_container_border_width (GtkContainer *CONTAINER, gint BORDER_WIDTH)

 -- Function: void gtk_container_add (GtkContainer *CONTAINER, GtkWidget *WIDGET)
     Add WIDGET to the CONTAINER.

 -- Function: void gtk_container_remove (GtkContainer *CONTAINER, GtkWidget *WIDGET)
     Remove WIDGET from CONTAINER.

 -- Function: void gtk_container_disable_resize (GtkContainer *CONTAINER)

 -- Function: void gtk_container_enable_resize (GtkContainer *CONTAINER)

 -- Function: void gtk_container_block_resize (GtkContainer *CONTAINER)

 -- Function: void gtk_container_unblock_resize (GtkContainer *CONTAINER)

 -- Function: gint gtk_container_need_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET)

 -- Function: void gtk_container_check_resize (GtkContainer *CONTAINER, GtkWidget *WIDGET)

 -- Function: void gtk_container_foreach (GtkContainer *CONTAINER, GtkCallback CALLBACK, gpointer CALLBACK_DATA)

 -- Function: void gtk_container_focus (GtkContainer *CONTAINER, GtkDirectionType DIRECTION)

 -- Function: GList* gtk_container_children (GtkContainer CONTAINER)

Container, CONTAINER

The curve widget
================

Description
-----------

Derived from see GtkDrawingArea.

Options
-------

 -- User Option: type

       * GTK_CURVE_TYPE_LINEAR

       * GTK_CURVE_TYPE_SPLINE

       * GTK_CURVE_TYPE_FREE

Signals
-------

Functions
---------

 -- Function: guint gtk_curve_get_type (void)
     Returns the GtkCurve type identifier.

 -- Function: GtkWidget* gtk_curve_new (void)
     Create a new GtkCurve returning the new widget as a pointer to a GtkWidget object.

 -- Function: void gtk_curve_reset (GtkCurve *CURVE)

 -- Function: void gtk_curve_set_gamma (GtkCurve *CURVE, gfloat GAMMA)

 -- Function: void gtk_curve_set_range (GtkCurve *CURVE, gfloat MIN_X, gfloat MAX_X, gfloat MIN_Y, gfloat MAX_Y)

 -- Function: void gtk_curve_get_vector (GtkCurve *CURVE, int VECLEN, gfloat VECTOR[])

 -- Function: void gtk_curve_set_vector (GtkCurve *CURVE, int VECLEN, gfloat VECTOR[])

 -- Function: void gtk_curve_set_curve_type (GtkCurve *CURVE, GtkCurveType TYPE)

Curve, CURVE

The gamma curve widget
======================

Description
-----------

Lets the user edit a gamma curve (a one-to-one mapping usually used to adjust the intensity of an image to the physical characteristics of the output device).  You can set the minimum and maximum values for input and output.  You can set the initial vector as well.  You are guaranteed that every input value will have a (not necessarily unique) output value specified.  Derived from see GtkVBox.  Makes use of see GtkCurve to draw the curve.

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_gamma_curve_get_type (void)
     Returns the GtkGamma type identifier.

 -- Function: GtkWidget* gtk_gamma_curve_new (void)
     Create a new GtkGamma returning the new widget as a pointer to a GtkWidget object.

GammaCurve, GAMMACURVE

The dialog widget
=================

Description
-----------

The dialog widget is a window (see GtkWindow) that has a vertical box (see GtkVBox), a horizontal box (see GtkHBox), separated with a horizontal separator (see GtkHSeparator).

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_dialog_get_type (void)
     Returns the GtkDialog type identifier.

 -- Function: GtkWidget* gtk_dialog_new (void)
     Create a new GtkDialog object and return the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

Dialog, DIALOG

The drawing area widget
=======================

Description
-----------

A base class for widgets that need a box to draw into.  So far, only used by GtkCurve.

Options
-------

 -- User Option: width

 -- User Option: height

Signals
-------

Functions
---------

 -- Function: guint gtk_drawing_area_get_type (void)
     Returns the GtkDrawingArea type identifier.

 -- Function: GtkWidget* gtk_drawing_area_new (void)
     Create a new GtkDrawingArea object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_drawing_area_size (GtkDrawingArea *DAREA, gint WIDTH, gint HEIGHT)
     Set the size of the DAREA widget, created previously, to WIDTH and HEIGHT.

DrawingArea, DRAWING_AREA

The entry widget
================

Description
-----------

Enter text into this widget.  Derived from GtkEditable.  Can be set so it isn't editable.

Options
-------

 -- User Option: max
     With this option it is possible to set the TEXT_MAX_LENGTH to the value specified in the MAX option. This value is a guint16 value.

 -- User Option: text
     With this option it is possible to 'preload' the text that will be displayed in the entry widget to the string pointed to by TEXT.

Signals
-------

 -- Signal: void GtkEntry::insert_text (GtkEntry *ENTRY, gchar *TEXT, gint LENGTH, gint *POSITION)

 -- Signal: void GtkEntry::delete_text (GtkEntry *ENTRY, gint START_POS, gint END_POS)

 -- Signal: void GtkEntry::changed (GtkEntry *ENTRY)

 -- Signal: void GtkEntry::set_text (GtkEntry *ENTRY)

 -- Signal: void GtkEntry::activate (GtkEntry *ENTRY)

Functions
---------

 -- Function: guint gtk_entry_get_type (void)
     Returns the GtkEntry type identifier.

 -- Function: GtkWidget* gtk_entry_new (void)
     Create a new GtkEntry object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_entry_new_with_max_length (guint16 MAX)
     Create a new GtkEntry object initializing it with the value MAX. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_entry_set_text (GtkEntry *ENTRY, gchar *TEXT)
     Will set the text in the previously created GtkEntry object to TEXT. It is important to not set the fields of the GtkEntry structure directly (or, for that matter, any type derived from GtkObject).

 -- Function: void gtk_entry_append_text (GtkEntry *ENTRY, gchar *TEXT)
     Append the text that is in the TEXT argument to the widgets text. It is important to not set the fields of the GtkEntry structure directly.

 -- Function: void gtk_entry_prepend_text (GtkEntry *ENTRY, gchar *TEXT)
     Add the text in the TEXT argument to the text in the GtkEntry widget. It is important to not set the fields of the GtkEntry structure directly.

 -- Function: void gtk_entry_set_position (GtkEntry *ENTRY, gint POSITION)

 -- Function: void gtk_entry_set_visibility (GtkEntry *ENTRY, gint VISIBLE)
     Will make the keystrokes entered into the GtkEntry object invisible when VISIBLE is TRUE. Defaults to FALSE.

 -- Function: gchar* gtk_entry_get_text (GtkEntry *ENTRY)
     Returns the text that is contained in the GtkEntry as a pointer to a gchar variable.

Entry, ENTRY

The event box widget
====================

Description
-----------

Derived from see GtkBin.  Used by see GtkTreeItem.

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_event_box_get_type (void)
     Returns the GtkEventBox type identifier.

 -- Function: GtkWidget* gtk_event_box_new (void)
     Create a new GtkEventBox returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

GtkEventBox, EVENT_BOX

The file selection dialog widget
================================

Description
-----------

Options
-------

 -- User Option: title

 -- User Option: filename

Signals
-------

Functions
---------

 -- Function: guint gtk_file_selection_get_type (void)
     Returns the GtkFileSelection type identifier.

 -- Function: GtkWidget* gtk_file_selection_new (gchar *TITLE)
     Create a new GtkFileSelection object and return the new widget as a pointer to a GtkWidget. NULL is returned on failure.

 -- Function: void gtk_file_selection_set_filename (GtkFileSelection *FILESEL, gchar *FILENAME)

 -- Function: gchar* gtk_file_selection_get_filename (GtkFileSelection *FILESEL)

FileSelection, FILE_SELECTION

The fixed widget
================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_fixed_get_type (void)
     Returns the GtkFixed type identifier.

 -- Function: GtkWidget* gtk_fixed_new (void)
     Create a new GtkFixed object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_fixed_put_new (GtkFixed *FIXED, GtkWidget *WIDGET, gint16 X, gint16 Y)

 -- Function: void gtk_fixed_move (GtkFixed *FIXED, GtkWidget *WIDGET, gint16 X, gint16 Y)

Fixed, FIXED

The frame widget
================

Options
-------

 -- User Option: label

 -- User Option: xalign

 -- User Option: yalign

 -- User Option: type

Description
-----------

Signals
-------

Functions
---------

 -- Function: guint gtk_frame_get_type (void)
     Returns the GtkFrame type identifier.

 -- Function: GtkWidget* gtk_frame_new (gchar *LABEL)
     Create a new GtkFrame object initializing it with the value in LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_frame_set_label (GtkFrame *FRAME, gchar *LABEL)

 -- Function: void gtk_frame_set_label_align (GtkFrame *FRAME, gfloat XALIGN, gfloat YALIGN)

 -- Function: void gtk_frame_set_shadow_type (GtkFrame *FRAME, GtkShadowType TYPE)

Frame, FRAME

The gamma widget
================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_gamma_curve_get_type (void)
     Returns the GtkGamma type identifier.

 -- Function: GtkWidget* gtk_gamma_curve_new (void)
     Create a new GtkGamma object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

Gamma, GAMMA

The horizontal box widget
=========================

Description
-----------

Options
-------

 -- User Option: homogeneous
     This option controls whether each object in the box has the same size. In the case of the GtkHBox, this effects the width. If this option is set then the EXPAND option to the gtk_box_pack (see GtkBox) routines is always set to TRUE.

 -- User Option: spacing
     This option controls the amount of space that is added between the objects packed into this GtkVBox object.

Signals
-------

Functions
---------

 -- Function: guint gtk_hbox_get_type (void)
     Returns the GtkHBox type identifier.

 -- Function: GtkWidget* gtk_hbox_new (gint HOMOGENEOUS, gint SPACING)
     Create a new GtkHBox object initializing it with the values in HOMOGENEOUS and SPACING. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

HBox, HBOX

The horizontal button box widget
================================

Description
-----------

Options
-------

 -- User Option: spacing

 -- User Option: layout

Signals
-------

Functions
---------

 -- Function: guint gtk_hbutton_box_get_type (void)
     Returns the GtkHButtonBox type identifier.

 -- Function: GtkWidget* gtk_hbutton_box_new (void)
     Create a new GtkHButtonBox object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_hbutton_box_set_spacing_default (gint SPACING)

 -- Function: void gtk_hbutton_box_set_layout_default (gint LAYOUT)

 -- Function: gint gtk_hbutton_box_get_spacing_default (void)

 -- Function: gint gtk_hbutton_box_get_layout_default (void)

HButtonBox, HBUTTON_BOX

The horizontal paned widget
===========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: void gtk_hpaned_get_type (void)
     Returns the GtkHPaned type identifier.

 -- Function: GtkWidget* gtk_hpaned_new (void)
     Create a new GtkHPaned object returning the new widget as a pointer to a GtkWidget object.

HPaned, HPANED

The horizontal ruler widget
===========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_hruler_get_type (void)
     Returns the GtkHRuler type identifier.

 -- Function: GtkWidget* gtk_hruler_new (void)
     Create a new GtkHRuler object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

HRuler, HRULER

The horizontal scale widget
===========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_hscale_get_type (void)
     Returns the GtkHScale type identifier.

 -- Function: GtkWidget* gtk_hscale_new (GtkAdjustment *ADJUSTMENT)
     Create a new GtkHScale object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

HScale, HSCALE

The horizontal scrollbar widget
===============================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_hscrollbar_get_type (void)
     Returns the GtkHScrollbar type identifier.

 -- Function: GtkWidget* gtk_hscrollbar_new (GtkAdjustment *ADJUSTMENT)
     Create a new GtkHScrollbar object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

HScrollbar, HSCROLLBAR

The horizontal separator widget
===============================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_hseparator_get_type (void)
     Returns the GtkHSeparator type identifier.

 -- Function: GtkWidget* gtk_hseparator_new (void)
     Create a new GtkHSeparator object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

HSeparator, HSEPARATOR

The image widget
================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_image_get_type (void)
     Returns the GtkImage type identifier.

 -- Function: GtkWidget* gtk_image_new (GdkImage *VAL, GdkBitmap *MASK)
     Create a new GtkImage object initializing it with the values in VAL and MASK. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_image_set (GtkImage *IMAGE, GdkImage *VAL, GdkBitmap *MASK)

 -- Function: void gtk_image_get (GtkImage *IMAGE, GdkImage **VAL, GdkBitmap **MASK)

Image, IMAGE

The input dialog widget
=======================

Description
-----------

Options
-------

Signals
-------

 -- Signal: void GtkInputDialog::enable_device (GtkInputDialog *INPUTD, guint32 DEVID, gpointer *DATA)

 -- Signal: void GtkInputDialog::disable_device (GtkInputDialog *INPUTD, guint32 DEVID, gpointer *DATA)

Functions
---------

 -- Function: guint gtk_input_dialog_get_type (void)
     Returns the GtkInputDialog type identifier.

 -- Function: GtkWidget* gtk_input_dialog_new (void)
     Create a new GtkInputDialog object and return the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

InputDialog, INPUTDIALOG

The item widget
===============

Description
-----------

Signals
-------

 -- Signal: void GtkItem::select (GtkItem *ITEM)

 -- Signal: void GtkItem::deselect (GtkItem *ITEM)

 -- Signal: void GtkItem::toggle (GtkItem *TOGGLE)

Functions
---------

 -- Function: guint gtk_item_get_type (void)
     Returns the GtkItem type identifier.

 -- Function: void gtk_item_select (GtkItem *ITEM)

 -- Function: void gtk_item_deselect (GtkItem *ITEM)

 -- Function: void gtk_item_toggle (GtkItem *ITEM)

Item, ITEM

The label widget
================

Description
-----------

Options
-------

 -- User Option: str

Signals
-------

Functions
---------

 -- Function: guint gtk_label_get_type (void)
     Returns the GtkLabel type identifier.

 -- Function: GtkWidget* gtk_label_new (GtkLabel *LABEL, gchar *STR)
     Create a new GtkLabel object and initialize it with the text in STR. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_label_set (GtkLabel *LABEL, gchar *STR)
     Set the GtkLabel label value to the value passed in the STR argument.

 -- Function: void gtk_label_get (GtkLabel *LABEL, gchar **STR)
     Copies the current value in the GtkLabel label field to the variable passed in the STR argument.

Label, LABEL

The list widget
===============

Description
-----------

Signals
-------

 -- Signal: void GtkList::selection_changed (GtkList *LIST)

 -- Signal: void GtkList::select_child (GtkList *LIST, GtkWidget *CHILD)

 -- Signal: void GtkList::unselect_child (GtkList *LIST, GtkWidget *CHILD)

Functions
---------

 -- Function: guint gtk_list_get_type (void)
     Returns the GtkList type identifier.

 -- Function: GtkWidget* gtk_list_new (void)
     Create a new GtkList object and return the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_list_insert_items (GtkList *LIST, GList *ITEMS, gint POSITION)

 -- Function: void gtk_list_append_items (GtkList *LIST, GList *ITEMS)

 -- Function: void gtk_list_prepend_items (GtkList *LIST, GList *ITEMS)

 -- Function: void gtk_list_remove_items (GtkList *LIST, GList *ITEMS)

 -- Function: void gtk_list_clear_items (GtkList *LIST, gint START, gint END)

 -- Function: void gtk_list_select_item (GtkList *LIST, gint ITEM)

 -- Function: void gtk_list_unselect_item (GtkList *LIST, gint ITEM)

 -- Function: void gtk_list_select_child (GtkList *LIST, GtkWidget *CHILD)

 -- Function: void gtk_list_unselect_child (GtkList *LIST, GtkWidget *CHILD)

 -- Function: gint gtk_list_child_position (GtkList *LIST, GtkWidget *CHILD)

 -- Function: void gtk_list_set_selection_mode (GtkList *LIST, GtkSelectionMode MODE)

List, LIST

The list item widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_list_item_get_type (void)
     Returns the GtkListItem type identifier.

 -- Function: GtkWidget* gtk_list_item_new (void)
     Create a new GtkListItem object and return the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_list_item_new_with_label (gchar *LABEL)
     Create a new GtkListItem object initializing with the value LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_list_item_select (GtkListItem *LIST_ITEM)

 -- Function: void gtk_list_item_deselect (GtkListItem *LIST_ITEM)

ListItem, LIST_ITEM

The menu widget
===============

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_menu_get_type (void)
     Returns the GtkMenu type identifier.

 -- Function: GtkWidget* gtk_menu_new (void)
     Create a new GtkMenu object returning the new widget as a pointer to a GtkWidget. NULL is returned on failure.

 -- Function: void gtk_menu_append (GtkMenu *MENU, GtkWidget *CHILD)

 -- Function: void gtk_menu_prepend (GtkMenu *MENU, GtkWidget *CHILD)

 -- Function: void gtk_menu_insert (GtkMenu *MENU, GtkWidget *CHILD, gint POSITION)

 -- Function: void gtk_menu_popup (GtkMenu *MENU, GtkWidget *PARENT_MENU_SHELL, GtkWidget *PARENT_MENU_ITEM, GtkMenuPositionFunc FUNC, gpointer DATA, gint BUTTON)

 -- Function: void gtk_menu_popdown (GtkMenu *MENU)

 -- Function: GtkWidget* gtk_menu_get_active (GtkMenu *MENU)

 -- Function: void gtk_menu_set_active (GtkMenu *MENU)

 -- Function: void gtk_menu_set_accelerator_table (GtkMenu *MENU, GtkAcceleratorTable *TABLE)

Menu, MENU

The menu bar widget
===================

Description
-----------

Options
-------

 -- User Option: position

Signals
-------

Functions
---------

 -- Function: guint gtk_menu_bar_get_type (void)
     Returns the GtkMenuBar type identifier.

 -- Function: GtkWidget* gtk_menu_bar_new (void)
     Create a new GtkMenuBar object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_menu_bar_append (GtkMenuBar *MENU_BAR, GtkWidget *CHILD)

 -- Function: void gtk_menu_bar_prepend (GtkMenuBar *MENU_BAR, GtkWidget *CHILD)

 -- Function: void gtk_menu_bar_insert (GtkMenuBar *MENU_BAR, GtkWidget *CHILD, gint POSITION)

MenuBar, MENU_BAR

The menu item widget
====================

Description
-----------

Options
-------

Signals
-------

 -- Signal: void GtkMenuItem::activate (GtkMenuItem *MENU_ITEM)

Functions
---------

 -- Function: guint gtk_menu_item_get_type (void)
     Returns the GtkMenuItem type identifier.

 -- Function: GtkWidget* gtk_menu_item_new (void)
     Create a new GtkMenuItem object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_menu_item_new_with_label (gchar *LABEL)
     Create a new GtkMenuItem object initializing it with the value in LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_menu_item_set_submenu (GtkMenuItem *MENU_ITEM, GtkWidget *SUBMENU)

 -- Function: void gtk_menu_item_set_placement (GtkMenuItem *MENU_ITEM, GtkSubmenuPlacement PLACEMENT)

 -- Function: void gtk_menu_item_accelerator_size (GtkMenuItem *MENU_ITEM)

 -- Function: void gtk_menu_item_accelerator_text (GtkMenuItem *MENU_ITEM, gchar *BUFFER)

 -- Function: void gtk_menu_item_configure (GtkMenuItem *MENU_ITEM, gint SHOW_TOGGLE_INDICATOR, gint SHOW_SUBMENU_INDICATOR)

 -- Function: void gtk_menu_item_select (GtkMenuItem *MENU_ITEM)

 -- Function: void gtk_menu_item_deselect (GtkMenuItem *MENU_ITEM)

 -- Function: void gtk_menu_item_activate (GtkMenuItem *MENU_ITEM)

MenuItem, MENU_ITEM

The menu shell widget
=====================

Description
-----------

Options
-------

Signals
-------

 -- Signal: void GtkMenuShell::deactivate (GtkMenuShell *MENU_SHELL)

Functions
---------

 -- Function: guint gtk_menu_shell_get_type (void)
     Returns the GtkMenuShell type identifier.

 -- Function: void gtk_menu_shell_append (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD)

 -- Function: void gtk_menu_shell_prepend (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD)

 -- Function: void gtk_menu_shell_insert (GtkMenuShell *MENU_SHELL, GtkWidget *CHILD, gint POSITION)

 -- Function: void gtk_menu_shell_deactivate (GtkMenuShell *MENU_SHELL)

MenuShell, MENU_SHELL

The misc widget
===============

Description
-----------

Options
-------

 -- User Option: xalign

 -- User Option: yalign

 -- User Option: xpad

 -- User Option: ypad

Signals
-------

Functions
---------

 -- Function: guint gtk_misc_get_type (void)
     Returns the GtkMisc type identifier.

 -- Function: void gtk_misc_set_alignment (GtkMisc *MISC, gfloat XALIGN, gfloat YALIGN)

 -- Function: void gtk_misc_set_padding (GtkMisc *MISC, gint XPAD, gint YPAD)

Misc, MISC

The notebook widget
===================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_notebook_get_type (void)
     Returns the GtkNotebook type identifier.

 -- Function: GtkWidget* gtk_notebook_new (void)
     Create a new GtkNotebook object returning the new widget as a pointer to a GtkWidget object. NULL is returned on a failure.

 -- Function: void gtk_notebook_append_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL)

 -- Function: void gtk_notebook_prepend_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL)

 -- Function: void gtk_notebook_insert_page (GtkNotebook *NOTEBOOK, GtkWidget *CHILD, GtkWidget *TAB_LABEL, gint POSITION)

 -- Function: void gtk_notebook_remove_page (GtkNotebook *NOTEBOOK, gint PAGE_NUM)

 -- Function: void gtk_notebook_set_page (GtkNotebook *NOTEBOOK, gint PAGE_NUM)

 -- Function: void gtk_notebook_next_page (GtkNotebook *NOTEBOOK)

 -- Function: void gtk_notebook_prev_page (GtkNotebook *NOTEBOOK)

 -- Function: void gtk_notebook_set_tab_pos (GtkNotebook *NOTEBOOK, GtkPositionType POS)

 -- Function: void gtk_notebook_set_show_tabs (GtkNotebook *NOTEBOOK, gint SHOW_TABS)

 -- Function: void gtk_notebook_set_show_border (GtkNotebook *NOTEBOOK, gint SHOW_BORDER)

Notebook, NOTEBOOK

The option menu widget
======================

Description
-----------

Options
-------

 -- User Option: index

Signals
-------

Functions
---------

 -- Function: guint gtk_option_menu_get_type (void)
     Returns the GtkOptionMenu type identifier.

 -- Function: GtkWidget* gtk_option_menu_new (void)
     Create a new GtkOptionMenu object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_option_menu_get_menu (GtkOptionMenu *OPTION_MENU)

 -- Function: void gtk_option_menu_set_menu (GtkOptionMenu *OPTION_MENU, GtkWidget *MENU)

 -- Function: void gtk_option_menu_remove_menu (GtkOptionMenu *OPTION_MENU)

 -- Function: void gtk_option_menu_set_history (GtkOptionMenu *OPTION_MENU, gint INDEX)

OptionMenu, OPTION_MENU

The paned widget
================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_paned_get_type (void)
     Returns the GtkPaned type identifier.

 -- Function: void gtk_paned_add1 (GtkPaned *PANED, GtkWidget *CHILD)

 -- Function: void gtk_paned_add2 (GtkPaned *PANED, GtkWidget *CHILD)

 -- Function: void gtk_paned_handle_size (GtkPaned *PANED, guint16 SIZE)

 -- Function: void gtk_paned_gutter_size (GtkPaned *PANED, guint16 SIZE)

Paned, PANED

The pixmap widget
=================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_pixmap_get_type (void)
     Returns the GtkPixmap type identifier.

 -- Function: GtkWidget* gtk_pixmap_new (GdkPixmap *NORMAL, GdkPixmap *ACTIVE, GdkPixmap *PRELIGHT, GdkPixmap *SELECTED, GdkPixmap *INSENSITIVE)

 -- Function: void gtk_pixmap_set (GtkPixmap *PIXMAP, GdkPixmap *VAL, GtkStateType STATE)

 -- Function: void gtk_pixmap_get (GtkPixmap *PIXMAP, GdkPixmap **VAL, GtkStateType STATE)

Pixmap, PIXMAP

The preview widget
==================

Description
-----------

Options
-------

 -- User Option: type

 -- User Option: width

 -- User Option: height

Signals
-------

Functions
---------

 -- Function: guint gtk_preview_get_type (void)
     Returns the GtkPreview type identifier.

 -- Function: void gtk_preview_uninit (void)

 -- Function: GtkWidget* gtk_preview_new (GtkPreviewType TYPE)
     Create a new GtkPreview object initializing it with the values in TYPE. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_preview_size (GtkPreview *PREVIEW, gint WIDTH, gint HEIGHT)
     Set the size of the PREVIEW object to WIDTH and HEIGHT.

 -- Function: void gtk_preview_put (GtkPreview *PREVIEW, GdkWindow *WINDOW, GdkGC *GC, gint SRCX, gint SRCY, gint DESTX, gint DESTY, gint WIDTH, gint HEIGHT)

 -- Function: void gtk_preview_put_row (GtkPreview *PREVIEW, guchar *SRC, guchar *DEST, gint X, gint Y, gint W)

 -- Function: void gtk_preview_draw_row (GtkPreview *PREVIEW, guchar DATA, gint X, gint Y, gint W)

 -- Function: void gtk_preview_set_expand (GtkPreview *PREVIEW, gint EXPAND)

 -- Function: void gtk_preview_set_gamma (double GAMMA)

 -- Function: void gtk_preview_set_color_cube (guint NRED_SHADES, guint NGREEN_SHADES, guint NBLUE_SHADES, guint NGRAY_SHADES)

 -- Function: void gtk_preview_set_install_cmap (gint INSTALL_CMAP)

 -- Function: void gtk_preview_set_reserved (gint NRESERVED)

 -- Function: GdkVisual* gtk_preview_get_visual (void)

 -- Function: GdkColormap* gtk_preview_get_cmap (void)

 -- Function: GtkPreviewInfo* gtk_preview_get_info (void)

Preview, PREVIEW

The progress bar widget
=======================

Description
-----------

Options
-------

 -- User Option: percentage

Signals
-------

Functions
---------

 -- Function: guint gtk_progress_bar_get_type (void)
     Returns the GtkProgressBar type identifier.

 -- Function: GtkWidget* gtk_progress_bar_new (void)
     Create a new GtkProgressBar object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_progress_bar_update (GtkProgressBar *PBAR, gfloat PERCENTAGE)
     Cause the GtkProgressBar to update its visual appearance to reflect the PERCENTAGE.

ProgressBar, PROGRESS_BAR

The radio button widget
=======================

Description
-----------

Options
-------

 -- User Option: group

 -- User Option: label

Signals
-------

Functions
---------

 -- Function: guint gtk_radio_button_get_type (void)
     Returns the GtkRadioButton type identifier.

 -- Function: GtkWidget* gtk_radio_button_new (GSList *GROUP)
     Create a new GtkRadioButton object initializing it with the value in the GROUP argument. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_radio_button_new_with_label (GSList *GROUP, gchar *LABEL)
     Create a new GtkRadioButton object initializing it with the values in the GROUP and LABEL arguments. The new widget is returned as a pointer to GtkWidget object. NULL is returned on failure.

 -- Function: GSList* gtk_radio_button_group (GtkRadioButton *RADIO_BUTTON)

RadioButton, RADIO_BUTTON

The radio button widget
=======================

Description
-----------

Options
-------

 -- User Option: group

 -- User Option: label

Signals
-------

Functions
---------

 -- Function: guint gtk_radio_menu_item_get_type (void)
     Returns the GtkRadioMenuItem type identifier.

 -- Function: GtkWidget* gtk_radio_menu_item_new (GSList *GROUP)
     Create a new GtkRadioMenuItem object and initialize it with the values in GROUP. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_radio_menu_item_new_with_label (GSList *GROUP, gchar *LABEL)

 -- Function: GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *RADIO_MENU_ITEM)

RadioMenuItem, RADIO_MENU_ITEM

The range widget
================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_range_get_type (void)
     Returns the GtkRange type identifier.

 -- Function: GtkAdjustment* gtk_range_get_adjustment (GtkRange *RANGE)

 -- Function: void gtk_range_set_update_policy (GtkRange *RANGE, GtkUpdatePolicy POLICY)

 -- Function: void gtk_range_set_adjustment (GtkRange *RANGE, GtkAdjustment *ADJUSTMENT)

 -- Function: void gtk_range_draw_background (GtkRange *RANGE)

 -- Function: void gtk_range_draw_trough (GtkRange *RANGE)

 -- Function: void gtk_range_draw_slider (GtkRange *RANGE)

 -- Function: void gtk_range_draw_step_forw (GtkRange *RANGE)

 -- Function: void gtk_range_draw_step_back (GtkRange *RANGE)

 -- Function: void gtk_range_slider_update (GtkRange *RANGE)

 -- Function: gint gtk_range_trough_click (GtkRange *RANGE, gint X, gint Y)

 -- Function: void gtk_range_default_hslider_update (GtkRange *RANGE)

 -- Function: void gtk_range_default_vslider_update (GtkRange *RANGE)

 -- Function: gint gtk_range_default_htrough_click (GtkRange *RANGE, gint X, gint Y)

 -- Function: gint gtk_range_default_vtrough_click (GtkRange *RANGE, gint X, gint Y)

 -- Function: void gtk_range_default_hmotion (GtkRange *RANGE, gint XDELTA, gint YDELTA)

 -- Function: void gtk_range_default_vmotion (GtkRange *RANGE, gint XDELTA, gint YDELTA)

 -- Function: gfloat gtk_range_calc_value (GtkRange *RANGE, gint POSITION)

Range, RANGE

The ruler widget
================

Description
-----------

Options
-------

 -- User Option: metric

 -- User Option: lower

 -- User Option: upper

 -- User Option: position

 -- User Option: max_size

Signals
-------

Functions
---------

 -- Function: guint gtk_ruler_get_type (void)
     Returns the GtkRuler type identifier.

 -- Function: void gtk_ruler_set_metric (GtkRuler *RULER, GtkMetricType METRIC)

 -- Function: void gtk_ruler_set_range (GtkRuler *RULER, gfloat LOWER, gfloat UPPER, gfloat POSITION, gfloat MAX_SIZE)

 -- Function: void gtk_ruler_draw_ticks (GtkRuler *RULER)

 -- Function: void gtk_ruler_draw_pos (GtkRuler *RULER)

Ruler, RULER

The scale widget
================

Description
-----------

Options
-------

 -- User Option: digits

 -- User Option: draw_value

 -- User Option: pos

Signals
-------

Functions
---------

 -- Function: guint gtk_scale_get_type (void)
     Returns the GtkScale type identifier.

 -- Function: void gtk_scale_set_digits (GtkScale *SCALE, gint DIGITS)

 -- Function: void gtk_scale_set_draw_value (GtkScale *SCALE, gint DRAW_VALUE)

 -- Function: void gtk_scale_set_value_pos (GtkScale *SCALE, gint POS)

 -- Function: gint gtk_scale_value_width (GtkScale *SCALE)

 -- Function: void gtk_scale_draw_value (GtkScale *SCALE)

Scale, SCALE

The scrollbar widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_scrollbar_get_type (void)a
     Returns the GtkScrollbar type identifier.

Scrollbar, SCROLLBAR

The scrolled window widget
==========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_scrolled_window_get_type (void)
     Returns the GtkScrolledWindow type identifier.

 -- Function: GtkWidget* gtk_scrolled_window_new (GtkAdjustment *HADJUSTMENT, GtkAdjustment *VADJUSTMENT)
     Create a new GtkScrolledWindow object initializing it with the values in ADJUSTMENT and ADJUSTMENT. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *SCROLLED_WINDOW)

 -- Function: GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *SCROLLED_WINDOW)

 -- Function: void gtk_scrolled_window_set_policy (GtkScrolledWindow *SCROLLED_WINDOW, GtkPolicyType HSCROLLBAR_POLICY, GtkPolicyType VSCROLLBAR_POLICY)

ScrolledWindow, SCROLLED_WINDOW

The separator widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_separator_get_type (void)
     Returns the GtkSeparator type identifier.

Separator, SEPARATOR

The statusbar widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_statusbar_get_type (void)
     Returns the GtkStatusbar type identifier.

 -- Function: GtkWidget* gtk_statusbar_new (void)
     Create a new GtkStatusbar object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: gint gtk_statusbar_push (GtkStatusbar *STATUSBAR, gchar *TEXT)

 -- Function: void gtk_statusbar_pop (GtkStatusbar *STATUSBAR, gint CONTEXT_ID)

Statusbar, STATUSBAR

The table widget
================

Description
-----------

Options
-------

 -- User Option: rows

 -- User Option: columns

 -- User Option: homogeneous
     This option controls whether all child widgets in the GtkTable will be of the same size. The child widgets will be the size of the largest child.

Signals
-------

Functions
---------

 -- Function: guint gtk_table_get_type (void)
     Returns the GtkTable type identifier.

 -- Function: GtkWidget* gtk_table_new (gint ROWS, gint COLUMNS, gint HOMOGENEOUS)
     Create a new GtkTable object initializing it with the values in ROWS, COLUMNS and HOMOGENEOUS. The new widget is returned as a pointer to a GtkWidget. NULL is returned on failure.

 -- Function: void gtk_table_attach (GtkTable *TABLE, GtkWidget *CHILD, gint LEFT_ATTACH, gint RIGHT_ATTACH, gint TOP_ATTACH, gint BOTTOM_ATTACH, gint XOPTIONS, gint YOPTIONS, gint XPADDING, gint YPADDING)

 -- Function: void gtk_table_attach_defaults (GtkTable *TABLE, GtkWidget *WIDGET, gint LEFT_ATTACH, gint RIGHT_ATTACH, gint TOP_ATTACH, gint BOTTOM_ATTACH)

 -- Function: void gtk_table_set_row_spacing (GtkTable *TABLE, gint ROW, gint SPACING)

 -- Function: void gtk_table_set_col_spacing (GtkTable *TABLE, gint COL, gint SPACING)

 -- Function: void gtk_table_set_row_spacings (GtkTable *TABLE, gint SPACING)

 -- Function: void gtk_table_set_col_spacings (GtkTable *TABLE, gint SPACING)

Table, TABLE

The text widget
===============

Description
-----------

Signals
-------

Functions
---------

 -- Function: guint gtk_text_get_type (void)
     Returns the GtkText type identifier.

 -- Function: GtkWidget* gtk_text_new (GtkAdjustment *HADJ, GtkAdjustment *VADJ);
     Create a new GtkText object initializing it with the values in HADJ and VADJ. The new widget is returned as a pointer to a GtkWidget. NULL is returned on failure.

 -- Function: void gtk_text_set_editable (GtkText *TEXT, gint EDITABLE)

 -- Function: void gtk_text_set_adjustments (GtkText *TEXT, GtkAdjustment *HADJ, GtkAdjustment *VADJ)

 -- Function: void gtk_text_set_point (GtkText *TEXT, guint INDEX)

 -- Function: guint gtk_text_get_point (GtkText *TEXT)

 -- Function: guint gtk_text_get_length (GtkText *TEXT)

 -- Function: void gtk_text_freeze (GtkText *TEXT)

 -- Function: void gtk_text_thaw (GtkText *TEXT)

 -- Function: void gtk_text_insert (GtkText *TEXT, GdkFont *FONT, GdkColor *FORE, GdkColor *BACK, char *CHARS, gint LENGTH)

 -- Function: gint gtk_text_forward_delete (GtkText *TEXT, guint NCHARS)

 -- Function: gint gtk_text_backward_delete (GtkText *TEXT, guint NCHARS)

Text, TEXT

The toggle button widget
========================

Description
-----------

Another form of button (see GtkButton) with two states: on and off. The appearance is that of a button which stays pressed on the first click, and is released on the second click.

Options
-------

 -- User Option: state

Signals
-------

 -- Signal: void GtkToggleButton::toggled (GtkToggleButton *TOGGLE_BUTTON)

Functions
---------

 -- Function: guint gtk_toggle_button_get_type (void)
     Returns the GtkToggleButton type identifier.

 -- Function: GtkWidget* gtk_toggle_button_new (void)
     Create a new GtkToggleButton object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_toggle_button_new_with_label (gchar *LABEL)
     Create a new GtkToggleButton object initializing it with the values in LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_toggle_button_set_mode (GtkToggleButton *TOGGLE_BUTTON, gint DRAW_INDICATOR)

 -- Function: void gtk_toggle_button_set_state (GtkToggleButton *TOGGLE_BUTTON, gint STATE)

 -- Function: void gtk_toggle_button_toggled (GtkToggleButton *TOGGLE_BUTTON)

ToggleButton, TOGGLE_BUTTON

The tool bar widget
===================

Description
-----------

Options
-------

 -- User Option: orientation

       * GTK_ORIENTATION_HORIZONTAL

       * GTK_ORIENTATION_VERTICAL

 -- User Option: style

       * GTK_TOOLBAR_ICONS

       * GTK_TOOLBAR_TEXT

       * GTK_TOOLBAR_BOTH

 -- User Option: space_size

Signals
-------

Functions
---------

 -- Function: guint gtk_toolbar_get_type (void)
     Returns the GtkToolbar type identifier.

 -- Function: GtkWidget* gtk_toolbar_new (GtkOrientation ORIENTATION, GtkToolbarStyle STYLE)
     Create a new GtkToolbar object initializing it with the values ORIENTATION and STYLE. NULL is returned on failure.

 -- Function: void gtk_toolbar_append_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA)

 -- Function: void gtk_toolbar_prepend_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA)

 -- Function: void gtk_toolbar_insert_item (GtkToolbar *TOOLBAR, char *TEXT, char *TOOLTIP_TEXT, GtkPixmap *ICON, GtkSignalFunc CALLBACK, gpointer USER_DATA, gint POSITION)

 -- Function: void gtk_toolbar_append_space (GtkToolbar *TOOLBAR)

 -- Function: void gtk_toolbar_prepend_space (GtkToolbar *TOOLBAR)

 -- Function: void gtk_toolbar_insert_space (GtkToolbar *TOOLBAR, gint POSITION)

 -- Function: void gtk_toolbar_set_orientation (GtkToolbar *TOOLBAR, GtkOrientation ORIENTATION)

 -- Function: void gtk_toolbar_set_style (GtkToolbar *TOOLBAR, GtkToolbarStyle STYLE)
     Set the STYLE of the TOOLBAR to STYLE.

 -- Function: void gtk_toolbar_set_space_size (GtkToolbar *TOOLBAR, gint SPACE_SIZE)

 -- Function: void gtk_toolbar_set_tooltips (GtkToolbar *TOOLBAR, gint ENABLE)

Toolbar, TOOLBAR

The tool tips widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: GtkTooltips* gtk_tooltips_new (void)
     Create a new GtkTooltips object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkTooltips* gtk_tooltips_ref (GtkTooltips *TOOLTIPS)

 -- Function: void gtk_tooltips_unref (GtkTooltips *TOOLTIPS)

 -- Function: void gtk_tooltips_free_string (gpointer DATA, gpointer USER_DATA)

 -- Function: void gtk_tooltips_enable (GtkTooltips *TOOLTIPS)

 -- Function: void gtk_tooltips_disable (GtkTooltips *TOOLTIPS)

 -- Function: void gtk_tooltips_set_delay (GtkTooltips *TOOLTIPS, GtkWidget *WIDGET, gchar *TIPS_TEXT)

 -- Function: void gtk_tooltips_set_colors (GtkTooltips *TOOLTIPS, GdkColor *BACKGROUND, GdkColor *FOREGROUND)

Tooltips, TOOLTIPS

The tree widget
===============

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_tree_get_type (void)
     Returns the GtkTree type identifier.

 -- Function: GtkWidget* gtk_tree_new (void)
     Create a new GtkTree object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_tree_append (GtkTree *TREE, GtkWidget *CHILD)

 -- Function: void gtk_tree_prepend (GtkTree *TREE, GtkWidget *CHILD)

 -- Function: void gtk_tree_insert (GtkTree *TREE, GtkWidget *CHILD, gint POSITION)

 -- Function: gint gtk_tree_child_position (GtkTree *TREE, GtkWidget *CHILD)

 -- Function: void gtk_tree_clear_items (GtkTree *TREE, gint START, gint END)

 -- Function: void gtk_tree_remove_items (GtkTree *TREE, GList *ITEMS)

 -- Function: void gtk_tree_select_child (GtkTree *TREE, GtkWidget *CHILD)

 -- Function: void gtk_tree_select_item (GtkTree *TREE, gint ITEM)

 -- Function: void gtk_tree_unselect_child (GtkTree *TREE, GtkWidget *CHILD)

 -- Function: void gtk_tree_unselect_item (GtkTree *TREE, gint ITEM)

 -- Function: void gtk_tree_set_selection_mode (GtkTree *TREE, GtkSelectionMode MODE)

 -- Function: void gtk_tree_set_view_mode (GtkTree *TREE, GtkTreeViewMode MODE)

 -- Function: void gtk_tree_set_view_lines (GtkTree *TREE, guint FLAG)

Tree, TREE

The tree item widget
====================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_tree_item_get_type (void)
     Returns the GtkTreeItem type identifier.

 -- Function: GtkWidget* gtk_tree_item_new (void)
     Create a new GtkTreeItem object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: GtkWidget* gtk_tree_item_new_with_label (gchar *LABEL)
     Create a new GtkTreeItem object initializing it with the values in LABEL. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_tree_item_set_subtree (GtkTreeItem *TREE_ITEM, GtkWidget *SUBTREE)

 -- Function: void gtk_tree_item_select (GtkTreeItem *TREE_ITEM)

 -- Function: void gtk_tree_item_deselect (GtkTreeItem *TREE_ITEM)

 -- Function: void gtk_tree_item_expand (GtkTreeItem *TREE_ITEM)

 -- Function: void gtk_tree_item_collapse (GtkTreeItem *TREE_ITEM)

 -- Function: void gtk_tree_item_remove_subtree (GtkTreeItem *ITEM)

TreeItem, TREE_ITEM

The vertical box widget
=======================

Description
-----------

Options
-------

 -- User Option: homogeneous
     This option controls whether each object in the box has the same size. In the case of the GtkVBox, this refers to the height. If this option is set then the EXPAND option to the gtk_box_pack (see GtkBox) routines is always turned on.

 -- User Option: spacing
     This option sets the amount of space that is added between the objects packed into this GtkVBox object.

Signals
-------

This widget does not define any new signals.

Functions
---------

 -- Function: guint gtk_vbox_get_type (void)
     Returns the GtkVBox type identifier.

 -- Function: GtkWidget* gtk_vbox_new (gint HOMOGENEOUS, gint SPACING)
     Create a new GtkVBox object initializing it with the values in HOMOGENEOUS and SPACING. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

VBox, VBOX

The vertical button box widget
==============================

Description
-----------

Options
-------

 -- User Option: spacing

 -- User Option: layout

Signals
-------

Functions
---------

 -- Function: guint gtk_vbutton_box_get_type (void)
     Returns the GtkVButtonBox type identifier.

 -- Function: GtkWidget* gtk_vbutton_box_new (void)
     Create a new GtkVButtonBox object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

 -- Function: void gtk_vbutton_box_set_spacing_default (gint SPACING)

 -- Function: void gtk_vbutton_box_set_layout_default (gint LAYOUT)

 -- Function: gint gtk_vbutton_box_get_spacing_default (void)

 -- Function: gint gtk_vbutton_box_get_layout_default (void)

VButtonBox, VBUTTON_BOX

The viewport widget
===================

Description
-----------

Signals
-------

Functions
---------

 -- Function: guint gtk_viewport_get_type (void)
     Returns the GtkViewport type identifier.

 -- Function: GtkWidget* gtk_viewport_new (GtkAdjustment *HADJUSTMENT, GtkAdjustment *VADJUSTMENT)

 -- Function: GtkAdjustment* gtk_viewport_get_hadjustment (GtkViewport *VIEWPORT)

 -- Function: GtkAdjustment* gtk_viewport_get_vadjustment (GtkViewport *VIEWPORT)

 -- Function: void gtk_viewport_set_hadjustment (GtkViewport *VIEWPORT, GtkAdjustment *ADJUSTMENT)

 -- Function: void gtk_viewport_set_vadjustment (GtkViewport *VIEWPORT, GtkAdjustment *ADJUSTMENT)

 -- Function: void gtk_viewport_set_shadow_type (GtkViewport *VIEWPORT, GtkShadowType TYPE)

Viewport, VIEWPORT

The vertical paned widget
=========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_vpaned_get_type (void)
     Returns the GtkVPaned type identifier.

 -- Function: GtkWidget* gtk_vpaned_new (void)
     Create a new GtkVPaned object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

VPaned, VPANED

The vertical ruler widget
=========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_vruler_get_type (void)
     Returns the GtkVRuler type identifier.

 -- Function: GtkWidget* gtk_vruler_new (void)
     Create a new GtkVRuler object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

VRuler, VRULER

The vertical ruler widget
=========================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_vscale_get_type (void)
     Returns the GtkVScale type identifier.

 -- Function: GtkWidget* gtk_vscale_new (GtkAdjustment *ADJUSTMENT)
     Create a new GtkVScale object returning the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

VScale, VSCALE

The vertical scrollbar widget
=============================

Description
-----------

Options
-------

Signals
-------

Functions
---------

 -- Function: guint gtk_vscrollbar_get_type (void)
     Returns the GtkVScrollbar type identifier.

 -- Function: GtkWidget* gtk_vscrollbar_new (GtkAdjustment *ADJUSTMENT)
     Create a new GtkVScrollbar object initializing it with the values in ADJUSTMENT. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure.

VScrollbar, VSCROLLBAR

The vertical separator widget
=============================

Description
-----------

Signals
-------

Functions
---------

 -- Function: guint gtk_vseparator_get_type (void)
     Returns the GtkVSeparator type identifier.

 -- Function: GtkWidget* gtk_vseparator_new (void)
     Create a new GtkVSeparator object and return the new widget as a pointer to a GtkWidget object. NULL is returned on failure.

VSeparator, VSEPARATOR

The base widget
===============

Description
-----------

Signals
-------

 -- Signal: void GtkWidget::show (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::hide (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::map (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::unmap (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::realize (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::unrealize (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::draw (GtkWidget *WIDGET, GdkRectangle *AREA)

 -- Signal: void GtkWidget::draw_focus (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::draw_default (GtkWidget *WIDGET)

 -- Signal: void GtkWidget::size_request (GtkWidget *WIDGET, GtkRequisition *REQUISITION)

 -- Signal: void GtkWidget::size_allocate (GtkWidget *WIDGET, GtkAllocation *ALLOCATION)

 -- Signal: void GtkWidget::state_changed (GtkWidget *WIDGET)

 -- Signal: gint GtkWidget::install_accelerator (GtkWidget *WIDGET, gchar *SIGNAL_NAME, gchar KEY, guint8 MODIFIERS)

 -- Signal: void GtkWidget::remove_accelerator (GtkWidget *WIDGET, gchar *SIGNAL_NAME)

 -- Signal: gint GtkWidget::event (GtkWidget *WIDGET, GdkEvent *EVENT)

 -- Signal: gint GtkWidget::button_press_event (GtkWidget *WIDGET, GdkEventButton *EVENT)

 -- Signal: gint GtkWidget::button_release_event (GtkWidget *WIDGET, GdkEventButton *EVENT)

 -- Signal: gint GtkWidget::motion_notify_event (GtkWidget *WIDGET, GdkEventMotion *EVENT)

 -- Signal: gint GtkWidget::delete_event (GtkWidget *WIDGET, GdkEventAny *EVENT)

 -- Signal: gint GtkWidget::destroy_event (GtkWidget *WIDGET, GdkEventAny *EVENT)

 -- Signal: gint GtkWidget::expose_event (GtkWidget *WIDGET, GdkEventExpose *EVENT)

 -- Signal: gint GtkWidget::key_press_event (GtkWidget *WIDGET, GdkEventKey *EVENT)

 -- Signal: gint GtkWidget::key_release_event (GtkWidget *WIDGET, GdkEventKey *EVENT)

 -- Signal: gint GtkWidget::enter_notify_event (GtkWidget *WIDGET, GdkEventCrossing *EVENT)

 -- Signal: gint GtkWidget::leave_notify_event (GtkWidget *WIDGET, GdkEventCrossing *EVENT)

 -- Signal: gint GtkWidget::configure_event (GtkWidget *WIDGET, GdkEventConfigure *EVENT)

 -- Signal: gint GtkWidget::focus_in_event (GtkWidget *WIDGET, GdkEventFocus *EVENT)

 -- Signal: gint GtkWidget::focus_out_event (GtkWidget *WIDGET, GdkEventFocus *EVENT)

 -- Signal: gint GtkWidget::map_event (GtkWidget *WIDGET, GdkEventAny *EVENT)

 -- Signal: gint GtkWidget::unmap_event (GtkWidget *WIDGET, GdkEventAny *EVENT)

 -- Signal: gint GtkWidget::property_notify_event (GtkWidget *WIDGET, GdkEventProperty *EVENT)

 -- Signal: gint GtkWidget::selection_clear_event (GtkWidget *WIDGET, GdkEventSelection *EVENT)

 -- Signal: gint GtkWidget::selection_request_event (GtkWidget *WIDGET, GdkEventSelection *EVENT)

 -- Signal: gint GtkWidget::selection_notify_event (GtkWidget *WIDGET, GdkEventSelection *EVENT)

 -- Signal: gint GtkWidget::drop_event (GtkWidget *WIDGET, GdkEventDrop *EVENT)

 -- Signal: gint GtkWidget::drag_begin_event (GtkWidget *WIDGET, GdkEventDragBegin *EVENT)

 -- Signal: gint GtkWidget::other_event (GtkWidget *WIDGET, GdkEventOther *EVENT)

Functions
---------

 -- Function: guint gtk_widget_get_type (void)
     Returns the GtkWidget type identifier.

 -- Function: void gtk_widget_class_init (GtkWidgetClass *CLASS)

 -- Function: void gtk_widget_init (GtkWidget *WIDGET)

 -- Function: void gtk_widget_destroy (GtkWidget *WIDGET)

 -- Function: void gtk_widget_show (GtkWidget *WIDGET)

 -- Function: void gtk_widget_hide (GtkWidget *WIDGET)

 -- Function: void gtk_widget_map (GtkWidget *WIDGET)

 -- Function: void gtk_widget_unmap (GtkWidget *WIDGET)

 -- Function: void gtk_widget_realize (GtkWidget *WIDGET)

 -- Function: void gtk_widget_unrealize (GtkWidget *WIDGET)

 -- Function: void gtk_widget_draw (GtkWidget *WIDGET, GdkRectangle *AREA)

 -- Function: void gtk_widget_draw_focus (GtkWidget *WIDGET)

 -- Function: void gtk_widget_draw_children (GtkWidget *WIDGET)

 -- Function: void gtk_widget_size_request (GtkWidget *WIDGET, GtkRequisition *REQUISITION)

 -- Function: void gtk_widget_size_allocate (GtkWidget *WIDGET, GtkAllocation *ALLOCATION)

 -- Function: void gtk_widget_install_accelerator (GtkWidget *WIDGET, GtkAcceleratorTable *TABLE, gchar *SIGNAL_NAME, gchar KEY, guint8 MODIFIERS)

 -- Function: void gtk_widget_remove_accelerator (GtkWidget *WIDGET, GtkAcceleratorTable *TABLE, gchar *SIGNAL_NAME)

 -- Function: gint gtk_widget_event (GtkWidget *WIDGET, GdkEvent *EVENT)

 -- Function: void gtk_widget_reparent (GtkWidget *WIDGET, GtkWidget *NEW_PARENT)

 -- Function: void gtk_widget_popup (GtkWidget *WIDGET, gint X, gint Y)

 -- Function: gint gtk_widget_intersect (GtkWidget *WIDGET, GdkRectangle *AREA, GdkRectangle *INTERSECTION)

 -- Function: void gtk_widget_grab_focus (GtkWidget *WIDGET)

 -- Function: void gtk_widget_grab_default (GtkWidget *WIDGET)

 -- Function: void gtk_widget_restore_state (GtkWidget *WIDGET)

 -- Function: void gtk_widget_set_name (GtkWidget *WIDGET, gchar *NAME)

 -- Function: void gtk_widget_set_state (GtkWidget *WIDGET, GtkStateType STATE)

 -- Function: void gtk_widget_set_sensitive (GtkWidget *WIDGET, gint sensitive)

 -- Function: void gtk_widget_set_parent (GtkWidget *WIDGET, GtkWidget *PARENT)

 -- Function: void gtk_widget_set_style (GtkWidget *WIDGET, GtkStyle *STYLE)

 -- Function: void gtk_widget_set_uposition (GtkWidget *WIDGET, gint X, gint Y)

 -- Function: void gtk_widget_set_usize (GtkWidget *WIDGET, gint WIDTH, gint HEIGHT)

 -- Function: GtkWidget* gtk_widget_get_toplevel (GtkWidget *WIDGET)

 -- Function: GtkWidget* gtk_widget_get_ancestor (GtkWidget *WIDGET, gint TYPE)

 -- Function: GdkColormap* gtk_widget_get_colormap (GtkWidget *WIDGET)

 -- Function: GdkVisual* gtk_widget_get_visual (GtkWidget *VISUAL)

 -- Function: GtkStyle* gtk_widget_get_style (GtkWidget *STYLE)

Widget, WIDGET

The window widget
=================

Description
-----------

Options
-------

 -- User Option: type
     The TYPE options specify how this widget will interact with the window manager. Currently the following types and the effect they have on the window to window manager interaction is as follows.

       * GTK_WINDOW_TOPLEVEL

            * The option GTK_WINDOW_TOPLEVEL is usually used for the main application window that will remain for the entire application run.

       * GTK_WINDOW_DIALOG

            * The option GTK_WINDOW_DIALOG is usually used for transient windows. These windows will open up, gather some input or provide some application specific updates, then close. The window manager is free not to provide all the 'normal' window functions to this window.

       * GTK_WINDOW_POPUP

            * The option GTK_WINDOW_POPUP is usually used for transient windows. These windows are typically used for when no user interaction is required, to notify the user of some condition. Other uses for these types of windows are for 'about windows', startup windows and the like. Typically the window manager will not provide the usual widgets that surround the window. At the most all that will be provided is a border. Also note that windows that set this TYPE will not be in any window list of the window manager. Though this window will not get the kill and close widgets of the window manager they still can receive said events and should be taken into account.

 -- User Option: title
     The TITLE option will set the title of the window in the window manager. Note: On windows that have the TYPE option set to GTK_WINDOW_POPUP there is a strong possibility that this will text will not be seen.

 -- User Option: position
     The POSITION option will determine where the window will be displayed when it is finally drawn to the screen. Currently the following positions and the effect they have on window placement can be specified.

       * GTK_WIN_POS_NONE

            * This POSITION type will allow the window manager full freedom, depending on the current settings in the window manager. As to where the window will be placed.

       * GTK_WIN_POS_CENTER

            * This POSITION option will cause the window to center itself on the the screen. This option setting will take into account the VIRTUAL SCREEN size when calculating the center. This is not the same as the VIRTUAL DESKTOP setting of many window managers. It will center itself on the current VIRTUAL DESKTOP.

       * GTK_WIN_POS_MOUSE

               This POSITION option will cause the window to center itself under the mouse pointers' current location. Typical uses for this setting is in warning/error/informational dialogs where user interaction is desired.

Signals
-------

 -- Signal: void GtkWindow::move_resize (GtkWindow *WINDOW, gint *X, gint *Y, gint WIDTH, gint HEIGHT)

 -- Signal: void GtkWindow::set_focus (GtkWindow *WINDOW, GtkWidget *FOCUS)

Functions
---------

 -- Function: guint gtk_window_get_type (void)
     Returns the GtkWindow type identifier.

 -- Function: GtkWidget* gtk_window_new (GtkWindowType TYPE)
     Create a new GtkWindow object. The new widget is returned as a pointer to a GtkWidget object. NULL is returned on failure. The TYPE can be one of GTK_WINDOW_TOPLEVEL, GTK_WINDOW_DIALOG or, GTK_WINDOW_POPUP. The TYPE value determines how this widget will interact with the window manager.

 -- Function: void gtk_window_set_title (GtkWindow *WINDOW, gchar *TITLE)
     Set the title of this window to the text in the TITLE argument. It is important to not set the fields of the GtkWindow structure directly.

 -- Function: void gtk_window_set_focus (GtkWindow *WINDOW, GtkWidget *FOCUS)

 -- Function: void gtk_window_set_default (GtkWindow *WINDOW, GtkWidget *DEFAULTW)

 -- Function: void gtk_window_set_policy (GtkWindow *WINDOW, gint ALLOW_SHRINK, gint ALLOW_GROW, gint AUTO_SHRINK)

 -- Function: void gtk_window_add_accelerator_table (GtkWindow *WINDOW, GtkAcceleratorTable *TABLE)

 -- Function: void gtk_window_remove_accelerator_table (GtkWindow *WINDOW, GtkAcceleratorTable *TABLE)

 -- Function: void gtk_window_position (GtkWindow *WINDOW, GtkWindowPosition POSITION)
     Set the position that the window will be at when it is finally drawn to the screen. The POSITION argument effects the the position as described above.

Window, WINDOW

Utility objects
***************

The accelerator table object
============================

Description
-----------

Functions
---------

 -- Function: GtkAcceleratorTable* gtk_accelerator_table_new (void)

 -- Function: GtkAcceleratorTable* gtk_accelerator_table_find (GtkObject *OBJECT, gchar *SIGNAL_NAME, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS)

 -- Function: GtkAccelerator *gtk_accelerator_table_ref (GtkAcceleratorTable *TABLE)

 -- Function: void gtk_accelerator_table_unref (GtkAcceleratorTable *TABLE)

 -- Function: void gtk_accelerator_table_install (GtkAcceleratorTable *TABLE, GtkObject *OBJECT, gchar *SIGNAL_NAME, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS)

 -- Function: void gtk_accelerator_table_remove (GtkAcceleratorTable *TABLE, GtkObject *OBJECT, gchar *SIGNAL_NAME)

 -- Function: void gtk_accelerator_table_check (GtkAcceleratorTable *TABLE, guchar ACCELERATOR_KEY, guint8 ACCELERATOR_MODS)

 -- Function: void gtk_accelerator_table_set_mod_mask (GtkAcceleratorTable *TABLE, guint8 MODIFIER_MASK)

The adjustment object
=====================

Description
-----------

Functions
---------

 -- Function: guint gtk_adjustment_get_type (void)
     Returns the GtkAdjustment type identifier.

 -- Function: GtkObject* gtk_adjustment_new (gfloat VALUE, gfloat LOWER, gfloat UPPER, gfloat STEP_INCREMENT, gfloat PAGE_INCREMENT, gfloat PAGE_SIZE)

GtkAdjustment, ADJUSTMENT

The GC object
=============

Description
-----------

Functions
---------

 -- Function: GdkGC* gtk_gc_get (gint DEPTH, GdkColormap *COLORMAP, GdkGCValues *VALUES, GdkGCValuesMask VALUES_MASK)

 -- Function: void gtk_gc_release (GdkGC *GC)

The data object
===============

Description
-----------

Functions
---------

 -- Function: guint gtk_data_get_type (void)
     Returns the GtkData type identifier.

Data, DATA

The style object
================

Description
-----------

Functions
---------

Initialization, exit and other features
***************************************

Initializing and exiting GTK
============================

Initializing
------------

Before any GTK functions can be utilized the library must be initialized. This can be accomplished by calling the gtk_init function. The arguments you pass to this function should be the same arguments that were passed to your application. This function will parse the arguments that it understands and handle initializing the GDK library for you.

Exiting
-------

Functions
---------

 -- Function: void gtk_init (int *ARGC, char **ARGV)
     Function to initialize GTK and GDK for you. This function will remove any command line arguments from ARGC and ARGV that it understands.

          int main (int argc, char *argv[])
          {
             ...Any local variables or non GTK/GDK initialization

             /* Initialize GTK. */
             gtk_init(&argc, &argc);

          }

 -- Function: void gtk_exit (int ERROR_CODE)
     Exit GTK and perform any necessary cleanup. gtk_exit will call the systems exit function passing ERROR_CODE as the parameter.

 -- Function: gint gtk_events_pending (void)
     Returns the number of events pending on the event queue.

 -- Function: void gtk_main (void)

 -- Function: guint gtk_main_level (void)

 -- Function: void gtk_main_quit (void)
     A call to this function will cause the gtk_main function to exit, thereby allowing your application to exit.

Customization of the library
============================

Description
-----------

Like other X-windows applications the GTK library provides a way for the user and application programmer to change the colors of just about any widget. You can also specify what pixmap should be tiled onto the background of some widgets. All this is handled through a similar method as in the standard X-windows environment, through the use of 'rc' files. The format and functions available in these files is discussed below.

Functions
---------

The following functions are available to handle the rc files.

 -- Function: void gtk_rc_parse (char *FILENAME)
     This function will parse the FILENAME that is passed to it as its argument. It will use the style settings for the widget types defined there.

 -- Function: void gtk_rc_init (void)
     This function will initialize the rc file parser, normally this need not be called directly as the gtk_rc_parse function will handle this for you.

Simplified menu creation
========================

Simplified tree creation
========================

Pop up help mechanism
=====================

Description
-----------

Resource Files
==============

Macros defined by all objects
=============================

There are three macros that are defined by all object types. The first two are used for performing casts and the last is for querying whether an object is of a particular type. These macros are both conveniences and debugging tools. If the GTK library was compiled with NDEBUG defined as a preprocessor symbol (via the -DNDEBUG to cc), then the macros check the object type and emit a warning if the cast is invalid. Doing such checking is fairly expensive since the cast macros are used everywhere in GTK and would normally be turned off in a public release of a product. Note: The functions below are indeed macros, but they may be considered functions for most purposes.

 -- Function: Gtk<ObjectType>* GTK_<OBJECT_TYPE> (gpointer OBJ)
     Cast a generic pointer to Gtk<ObjectType>*. This function is provided in order to be able to provide checking during development stages of code development since it is possible to examine the actual type of object (using gtk_type_is_a) before performing the cast.

 -- Function: Gtk<ObjectType>Class* GTK_<OBJECT_TYPE>_CLASS (gpointer CLASS)
     Cast a generic pointer to Gtk<ObjectType>Class*. Like GTK_<ObjectType>, this function is, in reality, a macro.

 -- Function: gint GTK_IS_<ObjectType> (gpointer OBJ)
     Determine if a generic pointer refers to a Gtk<ObjectType> object. This function is, in reality, a macro wrapper around the gtk_type_is_a function (see Objects).

Using GTK
*********

The simplest GTK program
========================

The 16 line GTK program shown below is just about the simplest possible program which uses GTK. (Well, technically, you don't have to create the window and it would still be a program which uses GTK). The program, when compiled and run, will create a single window 200x200 pixels in size. The program does not exit until its is explicitly killed using the shell or a window manager function.

     #include <gtk/gtk.h>

     int
     main (int argc, char *argv[])
     {
       GtkWidget *window;

       gtk_init (&argc, &argv);

       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       gtk_widget_show (window);

       gtk_main ();

       return 0;
     }

The first point of interest in this program is the standard initialization line.

       gtk_init (&argc, &argv);

Almost every GTK program will contain such a line. GTK will initialize itself and GDK and remove any command line arguments it recognizes from ARGC and ARGV.

The next two lines of code create and display a window.

       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       gtk_widget_show (window);

The GTK_WINDOW_TOPLEVEL argument specifies that we want the window to undergo window manager decoration and placement. One might be lead to think that the window, since it has no children, would be 0x0 pixels in size. But, this is not the case because a window that has no children defaults to 200x200 pixels in size. Mainly because 0x0 windows are annoying to manipulate or even see in some cases.

The last line enters the GTK main processing loop.

       gtk_main ();

Normally, gtk_main is called once and the program should exit when it returns. See Initialization and exit.

Hello world in GTK
==================

     #include <gtk/gtk.h>

     int
     main (int argc, char *argv[])
     {
       GtkWidget *window;
       GtkWidget *label;

       gtk_init (&argc, &argv);

       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       gtk_container_border_width (GTK_CONTAINER (window), 10);

       label = gtk_label_new ("Hello World");
       gtk_container_add (GTK_CONTAINER (window), label);
       gtk_widget_show (label);

       gtk_widget_show (window);

       gtk_main ();

       return 0;
     }

An enhanced hello world
=======================

     #include "gtk.h"

     void
     hello (void)
     {
       g_print ("Hello World\n");
       gtk_exit (0);
     }

     int
     main (int argc, char *argv[])
     {
       GtkWidget *window;
       GtkWidget *button;

       gtk_init (&argc, &argv);

       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       gtk_container_border_width (GTK_CONTAINER (window), 10);

       button = gtk_button_new_with_label ("Hello World");
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
     		      GTK_SIGNAL_FUNC (hello), NULL);
       gtk_container_add (GTK_CONTAINER (window), button);
       gtk_widget_show (button);

       gtk_widget_show (window);

       gtk_main ();

       return 0;
     }

Making Hello World II robust
============================

     #include "gtk.h"

     void
     hello (void)
     {
       g_print ("Hello World\n");
       gtk_exit (0);
     }

     void
     destroy (void)
     {
       gtk_exit (0);
     }

     int
     main (int argc, char *argv[])
     {
       GtkWidget *window;
       GtkWidget *button;

       gtk_init (&argc, &argv);

       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       gtk_signal_connect (GTK_OBJECT (window), "destroy",
     		      GTK_SIGNAL_FUNC (destroy), NULL);
       gtk_container_border_width (GTK_CONTAINER (window), 10);

       button = gtk_button_new_with_label ("Hello World");
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
     		      GTK_SIGNAL_FUNC (hello), NULL);
       gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
     			     GTK_SIGNAL_FUNC (gtk_widget_destroy),
     			     GTK_OBJECT (window));
       gtk_container_add (GTK_CONTAINER (window), button);
       gtk_widget_show (button);

       gtk_widget_show (window);

       gtk_main ();

       return 0;
     }

Object internals
****************

Objects (or the GtkObject type) and the class hierarchy in general is implemented via a hierarchy of structs and type casting. Be aware that when classes are mentioned it is the conceptual idea of classes that is being referred to. GTK is written entirely in C which provides no direct support for classes.

The first part to the class mechanism is the object fields. These are fields that will be used on a per object basis. For example, the widget type contains a field for the widgets parent. Every derived type needs a reference to its parent type. A descendant class of GtkObject would define itself like:

     struct Descendant
     {
       GtkObject object;

       ...
     };

It is important to note that the GtkObject field needs to appear first in the descendant type structure. This allows pointers to objects of type Descendant to be cast to pointers to GtkObject's and vice-versa.

The second part to the class mechanism is the class fields. These fields are defined on a per class basis. In the case of widgets, the class fields are all the ``virtual'' functions for widgets. The GtkObject class defines the destroy virtual function and the necessary fields for the signal mechanism as well as a field for determining the runtime type of an object. A virtual function is semantically the same as it is in C++. That is, the actual function that is called is determined based on the type of the object. Or, more specifically, the actual function call depends on the class structure that is pointed to by the klass field of the GtkObject structure.

To see how the class fields work it is necessary to see the object fields for a GtkObject. The GtkObject type is defined as follows:

     typedef struct _GtkObject GtkObject;

     struct _GtkObject
     {
       guint32 flags;
       GtkObjectClass *klass;
       gpointer object_data;
     };

The class field actually points to a class structure derived from GtkObjectClass. By convention, each new type defines its own class structure even if it is unnecessary. As an example, the hypothetical Descendant class would define its class structure as:

     struct DescendantClass
     {
       GtkObjectClass parent_class;

       ...
     };

It is convention to name the parent class field (GtkObjectClass in this case), parent_class. For the same reason as stated above for the object structure, the parent class field must be the first field in the class structure.

Note: GTK assumes that the first field in a structure will be placed by the compiler at the start of the structure. This is certainly true for gcc, however, from my precursory reading of the C standard I was unable to come to a definite conclusion as to whether this was required or simply done for simplicity. I'm not too worried about this assumption, though, as every C compiler I've ever encountered would work with GTK.

The flags field of the GtkObject structure is used to keep track of a relatively few object flags and is also used by the GtkWidget type to store additional flags. At this time, the upper 16 bits of the flags field are reserved but unused.

The object_data field of the GtkObject structure is an opaque pointer used by the object data mechanism. In truth, it is a pointer to the beginning of the data list which is composed of the following structures.

     typedef struct _GtkObjectData GtkObjectData;

     struct _GtkObjectData
     {
       guint id;
       gpointer data;
       GtkObjectData *next;
     };

The data mechanism allows arbitrary data to be associated with a character string key in any object. A hash table is used to transform the character string key into the data id and then a search through the list is made to see if the data exists. The assumption being that the data list will usually be short and therefore a linear search is OK. Future work on the data mechanism might make use of a resizable array instead of a linked list. This would shrink the overhead of the GtkObjectData structure by 4 bytes on 32 bit architectures.

Signal internals
****************

Widget internals
****************