This is gtkada_rm.info, produced by makeinfo version 4.0 from
gtkada_rm.texi.


File: gtkada_rm.info,  Node: Gtk.GLArea Subprograms,  Prev: Gtk.GLArea Types,  Up: Package_Gtk.GLArea

Subprograms
===========

procedure Gtk_New
     (Widget             : out    Gtk_GLArea;
        Attr_List          : in     Attributes_Array);

Make an OpenGL widget, Attr_List is passed to glXChooseVisual GLX call.
Attr_List specifies a list of Boolean attributes and enum/integer
attribute/value pairs.   See glXChooseVisual man page for more
explanation on Attr_List.   Widget is created with visual and colormap
of the  requested type and GLX context is created for this widget. You
can't do opengl calls on widget until it has X window. X window  is not
created until widget is realized.
procedure Gtk_New
     (Widget             : out    Gtk_GLArea;
        Attr_List          : in     Attributes_Array;
        Share              : access Gtk_GLArea_Record'Class);

Same as above.
Share specifies the widget with which to share display lists and
texture objects. A non initialized value indicates that no sharing is
to take place.
function Make_Current
     (Glarea             : access Gtk_GLArea_Record'Class)
        return Boolean;

Must be called before rendering into OpenGL widgets.
Return True if rendering to widget is possible. Rendering is not
possible if widget is not Gtk_GLArea widget or widget is not realized.
procedure Swap_Buffers
     (Glarea             : access Gtk_GLArea_Record'Class);

Promote contents of back buffer of Glarea to front buffer.
The contents of front buffer become undefined.

File: gtkada_rm.info,  Node: Package_Gtk.Gamma_Curve,  Next: Package_Gtk.Handle_Box,  Prev: Package_Gtk.GLArea,  Up: Top

Package Gtk.Gamma`_'Curve
*************************

The Gtk_Gamma_Curve widget is a child of Gtk_Curve specifically for
editing  gamma curves, which are used in graphics applications such as
the Gimp.

   The Gamma_Curve widget shows a curve which the user can edit with
the mouse  just like a Gtk_Curve widget. On the right of the curve it
also displays 5  buttons, 3 of which change between the 3 curve modes
(spline, linear and  free), and the other 2 set the curve to a
particular gamma value, or reset  it to a straight line.

* Menu:

* Gtk.Gamma_Curve Widget Hierarchy::
* Gtk.Gamma_Curve Subprograms::


File: gtkada_rm.info,  Node: Gtk.Gamma_Curve Widget Hierarchy,  Next: Gtk.Gamma_Curve Subprograms,  Up: Package_Gtk.Gamma_Curve

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Box         (*note Package_Gtk.Box::)
                 \___ Gtk_Gamma_Curve (*note Package_Gtk.Gamma_Curve::)


File: gtkada_rm.info,  Node: Gtk.Gamma_Curve Subprograms,  Prev: Gtk.Gamma_Curve Widget Hierarchy,  Up: Package_Gtk.Gamma_Curve

Subprograms
===========

procedure Gtk_New
     (Gamma_Curve        : out    Gtk_Gamma_Curve);

Create a new Gtk_Gamma_Curve.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Gamma_Curve.
function Get_Curve
     (Gamma_Curve        : access Gtk_Gamma_Curve_Record)
        return Gtk.Curve.Gtk_Curve;

Return the Curve widget associated with a Gamma_Curve.
function Get_Gamma
     (Gamma_Curve        : access Gtk_Gamma_Curve_Record)
        return Gfloat;

Return the Gamma value associated with a Gamma_Curve.

File: gtkada_rm.info,  Node: Package_Gtk.Handle_Box,  Next: Package_Gtk.Handlers,  Prev: Package_Gtk.Gamma_Curve,  Up: Top

Package Gtk.Handle`_'Box
************************

The Gtk_Handle_Box widget allows a portion of a window to be "torn off".
It is a bin widget which displays its child and a handle that the user
can  drag to tear off a separate window (the float window) containing
the child  widget. A thin ghost is drawn in the original location of
the handlebox. By  dragging the separate window back to its original
location, it can be  reattached.

   When reattaching, the ghost and float window, must be aligned along
one of  the edges, the snap edge. This either can be specified by the
application  programmer explicitely, or GtkAda will pick a reasonable
default based on  the handle position.

   To make detaching and reattaching the handlebox as minimally
confusing as  possible to the user, it is important to set the snap
edge so that the snap  edge does not move when the handlebox is
detached. For instance, if the  handlebox is packed at the bottom of a
Vbox, then when the handlebox is  detached, the bottom edge of the
handlebox's allocation will remain fixed  as the height of the
handlebox shrinks, so the snap edge should be set to  Pos_Bottom.

* Menu:

* Gtk.Handle_Box Widget Hierarchy::
* Gtk.Handle_Box Signals::
* Gtk.Handle_Box Subprograms::


File: gtkada_rm.info,  Node: Gtk.Handle_Box Widget Hierarchy,  Next: Gtk.Handle_Box Signals,  Up: Package_Gtk.Handle_Box

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Bin         (*note Package_Gtk.Bin::)
                 \___ Gtk_Handle_Box (*note Package_Gtk.Handle_Box::)


File: gtkada_rm.info,  Node: Gtk.Handle_Box Signals,  Next: Gtk.Handle_Box Subprograms,  Prev: Gtk.Handle_Box Widget Hierarchy,  Up: Package_Gtk.Handle_Box

Signals
=======

   * "child-attached"

     procedure Handler
     (Handle_Box : access Gtk_Handle_Box_Record'Class;
     Widget     : access Gtk_Widget_Record'Class);
     Emitted when the contents of the Handle_Box are reattached to the
     main window.  Widget is the child widget of the Handle_Box. (this
     argument provides no extra information and is here only for
     backwards-compatibility)

   * "child-detached"

     procedure Handler
     (Handle_Box : access Gtk_Handle_Box_Record'Class;
     Widget     : access Gtk_Widget_Record'Class);
     Emitted when the contents of the Handle_Box are detached from the
     main window. See "child-attached" for drtails on the parameters.



File: gtkada_rm.info,  Node: Gtk.Handle_Box Subprograms,  Prev: Gtk.Handle_Box Signals,  Up: Package_Gtk.Handle_Box

Subprograms
===========

procedure Gtk_New
     (Handle_Box         : out    Gtk_Handle_Box);

Create a new Handle_Box.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Dialog.
procedure Set_Shadow_Type
     (Handle_Box         : access Gtk_Handle_Box_Record;
        Typ                : in     Enums.Gtk_Shadow_Type);

Set the type of shadow to be drawn around the border of the Handle_Box.
procedure Set_Handle_Position
     (Handle_Box         : access Gtk_Handle_Box_Record;
        Position           : in     Enums.Gtk_Position_Type);

Set the side of the Handle_Box where the handle is drawn.
procedure Set_Snap_Edge
     (Handle_Box         : access Gtk_Handle_Box_Record;
        Edge               : in     Enums.Gtk_Position_Type);

Set the snap edge of a Handle_Box.
The snap edge is the edge of the detached child that must be aligned
with the corresponding edge of the "ghost" left behind when the child
was detached to reattach the torn-off window. Usually, the snap edge
should be chosen so that it stays in the same place on the screen when
the Handle_Box is torn off.

   If the snap edge is not set, then an appropriate value will be
guessed  from the handle position. If the handle position is Pos_Right
or  Pos_Left, then the snap edge will be Pos_Top, otherwise it will be
Pos_Left.

File: gtkada_rm.info,  Node: Package_Gtk.Handlers,  Next: Package_Gtk.Hbutton_Box,  Prev: Package_Gtk.Handle_Box,  Up: Top

Package Gtk.Handlers
********************

The aim of this package is to provide some services to connect a
handler to a signal emitted by a Gtk Object. To understand the
services provided by this package, some definitions are necessary:

   Signal: A signal is a kind of message that an object wants to
broadcast. All Gtk_Objects can emit signals. These messages are
associated to certain events happening during the life of an    object.
For instance, when a user clicks on a button, the    "clicked" signal
is emitted by the button.

   Handler (or callback): A handler is a function or procedure that
the user "connects" to a signal for a particular object.     Connecting
a handler to a signal means associating this handler to    the signal.
When the signal is emitted, all connected handlers    are called back.
Usually, the role of those callbacks is to do    some processing
triggered by a user action. For instance, when    "clicked" signal is
emitted by the "OK" button of a dialog, the    connected handler can be
used to close the dialog or recompute    some value.

   In GtkAda, the handlers are defined in a form as general as
possible. The first argument is always an access to the object it
has been connected to. The second object is a table of arguments
(See Gtk.Arguments for more details about this table). It is the
responsibility of this handler to extract the values from it, and    to
convert them to the correct Ada type.

   Because such handlers are not very convenient to use, this package
also provides some services to connect a marshaller instead. It
will then do the extraction work before calling the more
programmer-friendly handler, as defined in Gtk.Marshallers (see
Gtk.Marshallers for more details).

   The subdivision of this package is identical to Gtk.Marshallers; it
is made of four generic sub-packages, each representing one of the
four possible kinds of handlers: they can return a value or not, and
they can have some user specific data associated to them or not.
Selecting the right package depends on the profile of the handler.
For example, the handler for the "delete_event" signal of a  Gtk_Window
has a return value, and has an extra parameter (a Gint).   All handlers
also have a user_data field by default, but its usage  is optional. To
connect a handler to this signal, if the user_data  field is not used,
the Return_Callback generic should be  instantiated. On the other hand,
if the user_data field is  necessary, then the User_Return_Callback
generic should be used.

   Note also that the real handler in Gtk+ should expect at least as
many arguments as in the marshaller you are using. If your  marshaller
has one argument, the C handler must have at least one  argument too.

   The common generic parameter to all sub-packages is the widget type,
which is the basic widget manipulated. This can be
Gtk.Object.Gtk_Object_Record type if you want to reduce the number of
instantiations, but the conversion to the original type will have to be
done inside the handler.

   All sub-packages are organized in the same way.

   First, the type "Handler" is defined. It represents the general
form of the callbacks supported by the sub-package.

   The corresponding sub-package of Gtk.Marshallers is instantiated.

   A series of "Connect" procedures and functions is given. All cases
are covered: the functions return the Handler_Id of the newly
created association, while the procedures just connect the    handler,
dropping the Handler_Id; some services allow the user to    connect a
Handler while some others allow the usage of    Marshallers, which are
more convenient. Note that more than one    handler may be connected to
a signal; the handlers will then be    invoked in the order of
connection.

   Some "Connect_Object" services are also provided. Those services
never have a user_data. They accept an additional parameter called
Slot_Object. When the callback in invoked, the Gtk Object emitting
the signal is substituted by this Slot_Object.     These callbacks are
always automatically disconnected as soon as one    of the two widgets
involved is destroyed.

   There are several methods to connect a handler. For each method,
although the option of connecting a Handler is provided, the
recommended way is to use Marshallers. Each connect service is
documented below, in the first sub-package.

   A series of "To_Marshaller" functions are provided. They return
some marshallers for the most commonly used types in order to ease
the usage of this package. Most of the time, it will not be
necessary to use some other marshallers.

   As for the "To_Marshaller" functions, a series of "Emit_By_Name"
procedures are also provided for the same most common types, to
allow the user to easily emit signals. These procedures are mainly
intended for people building new Gtk_Objects.

   At the end of this package, some general services related to the
management of signals and handlers are also provided. Each one of  them
is documented individually below.

   IMPORTANT NOTE: These packages must be instantiated at library-level

* Menu:

* Gtk.Handlers Example::


File: gtkada_rm.info,  Node: Gtk.Handlers Example,  Up: Package_Gtk.Handlers

Example
=======

      --  This example connects the "delete_event" signal to a widget.
      --  The handlers for this signal get an extra argument which is
      --  the Gdk_Event that generated the signal.
     
      with Gtk.Handlers;    use Gtk.Handlers;
      with Gtk.Marshallers; use Gtk.Marshallers;
     
      function My_Cb (Widget : access Gtk_Widget_Record'Class;
                      Event  : Gdk.Event.Gdk_Event)
                      return Gint;
      --  your own function
     
      package Return_Widget_Cb is new Gtk.Handlers.Return_Callback
         (Gtk.Widget.Gtk_Widget_Record, Gint);
     
      Return_Widget_Cb.Connect (W, "delete_event",
         Return_Widget_Cb.To_Marshaller (My_Cb'Access));


File: gtkada_rm.info,  Node: Package_Gtk.Hbutton_Box,  Next: Package_Gtk.Image,  Prev: Package_Gtk.Handlers,  Up: Top

Package Gtk.Hbutton`_'Box
*************************

A Gtk_Hbutton_Box is a specific Gtk_Button_Box that organizes its
children horizontally.   The beginning of the box (when you add
children with Gtk.Box.Pack_Start)  is on the left of the box. Its end
(for Gtk.Box.Pack_End) is on the right.

* Menu:

* Gtk.Hbutton_Box Widget Hierarchy::
* Gtk.Hbutton_Box Subprograms::


File: gtkada_rm.info,  Node: Gtk.Hbutton_Box Widget Hierarchy,  Next: Gtk.Hbutton_Box Subprograms,  Up: Package_Gtk.Hbutton_Box

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Box         (*note Package_Gtk.Box::)
                 \___ Gtk_Button_Box (*note Package_Gtk.Button_Box::)
                    \___ Gtk_Hbutton_Box (*note Package_Gtk.Hbutton_Box::)


File: gtkada_rm.info,  Node: Gtk.Hbutton_Box Subprograms,  Prev: Gtk.Hbutton_Box Widget Hierarchy,  Up: Package_Gtk.Hbutton_Box

Subprograms
===========

procedure Gtk_New
     (Widget             : out    Gtk_Hbutton_Box);

Create a new horizontal button box.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_HButton_Box.
procedure Set_Spacing_Default
     (Spacing            : in     Gint);

Set the default spacing (space between two adjacent children).
This is done for all the Hbutton_Boxes in your application. This can be
overridden for a specific box by calling Gtk.Button_Box.Set_Spacing.
function Get_Spacing_Default   return Gint;

Return the default spacing to use for all Hbutton_Boxes in your
application that don't have a specific value.
procedure Set_Layout_Default
     (Layout             : in     Gtk.Enums.Gtk_Button_Box_Style);

Set the the default layout to use for all the hbutton_boxes in your
application that don't have a specific value set by
Gtk.Button_Box.Set_Layout. The default value is Buttonbox_Edge.
function Get_Layout_Default    return Gtk.Enums.Gtk_Button_Box_Style;

Return the default layout to use for all the hbutton_boxes.

File: gtkada_rm.info,  Node: Package_Gtk.Image,  Next: Package_Gtk.Item,  Prev: Package_Gtk.Hbutton_Box,  Up: Top

Package Gtk.Image
*****************

The Gtk_Image widget displays a graphical image. The image is typically
created using Gdk.Image.Gdk_New.

   The pixels in a Gtk_Image may be manipulated by the application after
creation, as Gtk_Image store the pixel data on the client side. If you
wish  to store the pixel data on the server side (thus not allowing
manipulation  of the data after creation) you should use Gtk_Pixmap.

* Menu:

* Gtk.Image Widget Hierarchy::
* Gtk.Image Subprograms::


File: gtkada_rm.info,  Node: Gtk.Image Widget Hierarchy,  Next: Gtk.Image Subprograms,  Up: Package_Gtk.Image

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Misc           (*note Package_Gtk.Misc::)
              \___ Gtk_Image       (*note Package_Gtk.Image::)


File: gtkada_rm.info,  Node: Gtk.Image Subprograms,  Prev: Gtk.Image Widget Hierarchy,  Up: Package_Gtk.Image

Subprograms
===========

procedure Gtk_New
     (Image              : out    Gtk_Image;
        Val                : in     Gdk.Image.Gdk_Image;
        Mask               : in     Gdk.Bitmap.Gdk_Bitmap);

function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Image.
procedure Get
     (Image              : access Gtk_Image_Record;
        Val                : out    Gdk.Image.Gdk_Image;
        Mask               : out    Gdk.Bitmap.Gdk_Bitmap);

Get the values of a Gtk_Image.
Mask indicates which parts of the image should be transparent.
procedure Set
     (Image              : access Gtk_Image_Record;
        Val                : in     Gdk.Image.Gdk_Image;
        Mask               : in     Gdk.Bitmap.Gdk_Bitmap);

Set the values of a Gtk_Image.
Mask indicates which parts of the image should be transparent.

File: gtkada_rm.info,  Node: Package_Gtk.Item,  Next: Package_Gtk.Label,  Prev: Package_Gtk.Image,  Up: Top

Package Gtk.Item
****************


File: gtkada_rm.info,  Node: Package_Gtk.Label,  Next: Package_Gtk.Layout,  Prev: Package_Gtk.Item,  Up: Top

Package Gtk.Label
*****************

A Gtk_Label is a light widget associated with some text you want  to
display on the screen. You can change the text dynamically if  needed.

   The text can be on multiple lines if you separate each line with
the ASCII.LF character. However, this is not the recommended way  to
display long texts (see the Gtk_Text widget instead)

* Menu:

* Gtk.Label Widget Hierarchy::
* Gtk.Label Subprograms::


File: gtkada_rm.info,  Node: Gtk.Label Widget Hierarchy,  Next: Gtk.Label Subprograms,  Up: Package_Gtk.Label

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Misc           (*note Package_Gtk.Misc::)
              \___ Gtk_Label       (*note Package_Gtk.Label::)


File: gtkada_rm.info,  Node: Gtk.Label Subprograms,  Prev: Gtk.Label Widget Hierarchy,  Up: Package_Gtk.Label

Subprograms
===========

procedure Gtk_New
     (Label              : out    Gtk_Label;
        Str                : in     String := "");

Create a new label.
Str is the string to be displayed.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Label.
procedure Set_Text
     (Label              : access Gtk_Label_Record;
        Str                : in     String);

Change the text of the label.
The new text is visible on the screen at once. Note that the underline
pattern is not modified.
procedure Set_Justify
     (Label              : access Gtk_Label_Record;
        Jtype              : in     Enums.Gtk_Justification);

Set the justification for the label.
The default value is Justify_Center, which means that the text will be
centered in the label. Note that this setting has an impact only when
the Gtk_Label is larger than the text (its default width is the same
as the text) and contains multiple lines.   To justify a single line
label, you should instead change the properties  of the container
handling the label (box, table, ...).
procedure Set_Pattern
     (Label              : access Gtk_Label_Record;
        Pattern            : in     String);

Change the underlines pattern.
Pattern is a simple string made of underscore and space characters,
matching the ones in the string. GtkAda will underline every letter
that matches an underscore.   An empty string disables the underlines.
example: If the text is FooBarBaz and the Pattern is "___   ___"  then
both "Foo" and "Baz" will be underlined, but not "Bar".
procedure Set_Line_Wrap
     (Label              : access Gtk_Label_Record;
        Wrap               : in     Boolean);

Toggle line wrapping within Label.
if Wrap is True, then Label will break lines if the text is larger
then the widget's size. If Wrap is False, then the text is simply  cut
off.
function Get
     (Label              : access Gtk_Label_Record)
        return String;

Get the current value of the text displayed in the label.
function Parse_Uline
     (Label              : access Gtk_Label_Record;
        Text               :        String)
        return Gdk.Types.Gdk_Key_Type;

Create both the text and the underscore pattern from a single string.
Text is parsed for underscores. The next character is converted to  an
underlined character.

File: gtkada_rm.info,  Node: Package_Gtk.Layout,  Next: Package_Gtk.Main,  Prev: Package_Gtk.Label,  Up: Top

Package Gtk.Layout
******************

A Gtk_Layout is a widget that can have an almost infinite size, without
occupying a lot of memory. Its children can be located anywhere within
it, but will only appear on the screen if the visible area of the
layout  contains them.   Just like a Gtk_Viewport, its visible area is
indicated by two  Gtk_Adjustment widgets, and thus a Gtk_Layout can be
put as is in a  Gtk_Scrolled_Window.   In fact, due to a bug in
gtk+1.2.6, you will have to do put in a scrolled  window. This of
course will be fixed in later versions.   As for Gtk_Fixed containers,
the children can be located anywhere in the  layout (no automatic
organization is done). But, as opposed to Gtk_Fixed  widgets, a
Gtk_Layout does not try to resize itself to show all its  children.

* Menu:

* Gtk.Layout Widget Hierarchy::
* Gtk.Layout Signals::
* Gtk.Layout Subprograms::


File: gtkada_rm.info,  Node: Gtk.Layout Widget Hierarchy,  Next: Gtk.Layout Signals,  Up: Package_Gtk.Layout

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Layout      (*note Package_Gtk.Layout::)


File: gtkada_rm.info,  Node: Gtk.Layout Signals,  Next: Gtk.Layout Subprograms,  Prev: Gtk.Layout Widget Hierarchy,  Up: Package_Gtk.Layout

Signals
=======

   * "set_scroll_adjustments"

     procedure Handler (Layout : access Gtk_Layout_Record'Class;
     Hadj   : in Gtk.Adjustment.Gtk_Adjustment;
     Vadj   : in Gtk.Adjustment.Gtk_Adjustment);
     Emitted whenever at least one of the adjustment of the layout is
     changed.



File: gtkada_rm.info,  Node: Gtk.Layout Subprograms,  Prev: Gtk.Layout Signals,  Up: Package_Gtk.Layout

Subprograms
===========

procedure Gtk_New
     (Layout             : out    Gtk_Layout;
        Hadjustment        :        Adjustment.Gtk_Adjustment
                            := Adjustment.Null_Adjustment;
        Vadjustment        :        Adjustment.Gtk_Adjustment
                            := Adjustment.Null_Adjustment);

Create new layout.
You can either give an explicit couple of adjustments, that will
indicate the current visible area. If you don't specify any, they will
be created automatically by GtkAda, which is the usual way to do.   The
Layout does not occupy any area on the screen, and you have to
explicitly specify one with Set_Size below.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Layout.
procedure Put
     (Layout             : access Gtk_Layout_Record;
        Widget             : access Gtk.Widget.Gtk_Widget_Record'Class;
        X                  : in     Gint;
        Y                  : in     Gint);

Insert a new child in the layout.
The child will be displayed on the screen only if at least part of  it
intersects the visible area of the layout.   The layout does not resize
itself to automatically show the widget.
procedure Move
     (Layout             : access Gtk_Layout_Record;
        Widget             : access Gtk.Widget.Gtk_Widget_Record'Class;
        X                  : in     Gint;
        Y                  : in     Gint);

Move a child of the layout.
Nothing is done if Widget is not already a child of Layout.
function Get_Bin_Window
     (Widget             : access Gtk_Layout_Record)
        return Gdk.Window.Gdk_Window;

Return the window associated with the layout.
You should use this one rather than Gtk.Widget.Get_Window.
procedure Set_Size
     (Layout             : access Gtk_Layout_Record;
        Width              : in     Guint;
        Height             : in     Guint);

Specify an absolute size for the layout.
This is not the size on the screen, but the internal size of the widget.
The screen's size can be set with Gtk.Widget.Set_Usize.
function Get_Hadjustment
     (Layout             : access Gtk_Layout_Record)
        return Gtk.Adjustment.Gtk_Adjustment;

Return the adjustment that indicate the horizontal visual area
of the layout.   You generally do not have to modify the value of this
adjustment  yourself, since this is done automatically when the layout
has  been put in a Gtk_Scrolled_Window.
function Get_Vadjustment
     (Layout             : access Gtk_Layout_Record)
        return Gtk.Adjustment.Gtk_Adjustment;

Return the adjustment that indicate the vertical visual area
of the layout.   You generally do not have to modify the value of this
adjustment  yourself, since this is done automatically when the layout
has  been put in a Gtk_Scrolled_Window.
procedure Set_Hadjustment
     (Layout             : access Gtk_Layout_Record;
        Adjustment         :        Gtk.Adjustment.Gtk_Adjustment);

Specify a new adjustment to use for the horizontal visual area.
procedure Set_Vadjustment
     (Layout             : access Gtk_Layout_Record;
        Adjustment         :        Gtk.Adjustment.Gtk_Adjustment);

Specify a new adjustment to use for the vertical visual area.
procedure Freeze
     (Layout             : access Gtk_Layout_Record);

Temporarily freezes the refreshing of the layout on the screen.
This should be used before doing long modifications to the children  to
speed up the update.   Note that each call to Freeze increments an
internal counter, and the  widget will only be thawed when the counter
reaches 0;
procedure Thaw
     (Layout             : access Gtk_Layout_Record);

Force an immediate update of the layout.
Every time a child is modified, the screen is refreshed.   This is the
opposite of Freeze.   This subprogram decrements the internal counter.
function Get_Xoffset
     (Layout             : access Gtk_Layout_Record)
        return Guint;

Get the current offset of the top-left corner.
function Get_Yoffset
     (Layout             : access Gtk_Layout_Record)
        return Guint;

Get the current offset of the top-left corner.
function Get_Width
     (Layout             : access Gtk_Layout_Record)
        return Guint;

Get the width in pixels of the layout.
function Get_Height
     (Layout             : access Gtk_Layout_Record)
        return Guint;

Get the height in pixels of the layout.

File: gtkada_rm.info,  Node: Package_Gtk.Main,  Next: Package_Gtk.Marshallers,  Prev: Package_Gtk.Layout,  Up: Top

Package Gtk.Main
****************

This package contains top-level subprograms that are used to initialize
GtkAda and interact with the main event loop.

   It also provides a set of packages to set up idle functions, timeout
functions, and functions to be called before and after entering the
main loop.

* Menu:

* Gtk.Main Types::
* Gtk.Main Subprograms::


File: gtkada_rm.info,  Node: Gtk.Main Types,  Next: Gtk.Main Subprograms,  Up: Package_Gtk.Main

Types
=====

type Idle_Callback is access function return Boolean;

Function that can be called automatically whenever GtkAda is not
processing events.   It should return True if the function should be
called again as soon  as possible, False if it should be unregistered.
type Idle_Handler_Id is new Guint;

Id for Idle handlers.
type Idle_Priority is new Guint;

Priorities that can be set for idle handlers.   The higher the
priority, the less urgent the task. Handlers whose  priority is lower
will be called before others.
type Init_Function is access procedure
     (Data : System.Address);

Function called just before starting the main loop.   This can be
registered with Init_Add below.
type Quit_Function is access function return Boolean;

Type of function that can be called when the main loop exits.   It
should return False if it should not be called again when another  main
loop exits.
type Quit_Handler_Id is new Guint;

registration ID for functions that will be called before the  main loop
exits.
type Timeout_Callback is access function return Boolean;

Function that can be called automatically at precise time intervals.
It should return True if the function should be called again as soon
as possible, False if it should be unregistered.
type Timeout_Handler_Id is new Guint;

Id for Timeout handlers.

File: gtkada_rm.info,  Node: Gtk.Main Subprograms,  Prev: Gtk.Main Types,  Up: Package_Gtk.Main

Subprograms
===========

Initialization and exit routines
--------------------------------

procedure Init;

Initialize GtkAda's internal structures.
This subprogram should be called before any other one in GtkAda.   If
GtkAda could not be initialized (no access to the display, etc.), the
application exits with an error
function Init_Check            return Boolean;

Initialize GtkAda's internal structures.
Return False if there was an error (no access to the display, etc.)
procedure Gtk_Exit
     (Error_Code         : in     Gint);

Terminate GtkAda cleanly, and quits the application.
function Set_Locale            return String;

Read and parse the local settings, such as time format, ...
Return the name of the local settings, which can also be set with  the
environment variable LOCALE
procedure Set_Locale;

Read and parse the local settings, such as time format, ...
Init and Quit functions
-----------------------

procedure Init_Add
     (Func               :        Init_Function;
        Data               :        System.Address);

Register a function to be called just before starting a main loop.
This function is called only once, even if a new main loop is started
recursively.
function Quit_Add
     (Main_Level         :        Guint;
        Func               :        Quit_Function)
        return Quit_Handler_Id;

Register a new function to be called when the current main loop exits.
The function will be called once when the current main loop exists.
If it returns False, it will then be deleted from the list of  quit
functions, and won't be called again next time a main loop is  exited.
The function will only be called when exiting a main loop at level
Main_Level. If Main_Level is 0, the function will be called for the
current main_loop.
function Quit_Add_Destroy
     (Main_Level         :        Guint;
        Object             : access Gtk.Object.Gtk_Object_Record'Class)
        return Quit_Handler_Id;

Ensure that Object is destroyed when exiting the main loop at Main_Level
(or the current main loop level is 0).
procedure Quit_Remove
     (Id                 :        Quit_Handler_Id);

Remove a Quit Handler, that has been previously set by Quit_Add.
The main loop
-------------

function Events_Pending        return Boolean;

Return True if there are some events waiting in the event queue.
procedure Main;

Start the main loop, and returns only when the main loop is exited.
This subprogram can be called recursively, to start new internal
loops. Each of these loops is exited through a call to Main_Quit.
This is the recommended method to use when you want to popup a dialog
and wait for the user answer before going any further.   Note that this
procedure can only be called within a single task.
function Main_Level            return Guint;

Return the level of the current main loop.
Since there can be nested loops, this returns the depth of the  current
one, starting from 1 (0 if there is none).
procedure Main_Quit;

Quit the current main loop.
If this was the last active main loop, no more events will be processed
by GtkAda.
function Main_Iteration
     (Blocking           : in     Boolean := True)
        return Boolean;

Do one iteration of the main loop.
Blocking indicates whether GtkAda should wait for an event to be
available, or simply exit if there is none.   Returns True if no main
loop is running  When doing some heavy calculations in an application,
it is recommended  that you check from time to time if there are any
events pending and  process them, so that your application still reacts
to events.   To do that, you would add a loop like:

   while Gtk.Main.Events_Pending loop

   Dead := Gtk.Main.Main_Iteration;

   end loop;
procedure Do_Event
     (Event              : in     Gdk.Event.Gdk_Event);

Process Event as if it was in the event queue.
This function should almost never be used in your own application, this
is the core function for event processing in GtkAda.   The user should
not free Event, this is already done by GtkAda.
function Get_Event_Widget
     (Event              : in     Gdk.Event.Gdk_Event)
        return Gtk.Widget.Gtk_Widget;

Return the widget to which Event applies.
Grab functions
--------------

procedure Grab_Add
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class);

Add a new widget to the grab list.
The widget at the front of this list gets all the events even if it does
not have the focus. This feature should be used with care.   If you
want a whole window to get the events, it is better to use
Gtk.Window.Set_Modal instead which does the grabbing and ungrabbing for
you.   The grab is only done for the application. Events outside the
application are still sent to their respective windows.
procedure Grab_Remove
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class);

Remove a widget from the grab list.
function Grab_Get_Current      return Gtk.Widget.Gtk_Widget;

Return the widget that currently has the focus.
Idle
----

GtkAda gives the possibility to register Idle functions.
These are called every time there is no more event to process in the
queue, and are used for instance internally to redraw widgets (so that
the application keeps reacting to user input even if there is a heavy
redrawing to do).   The Idle function returns a boolean, which should
be True if the idle  remains active and should be called again, or
False if the idle should  be unregistered.   The priority of these idle
callbacks can also be modified, so that  the scheduling calls one
callback before another.

   Two versions are given, either with a user data or with none.

function Idle_Add
     (Cb                 : in     Idle_Callback;
        Priority           : in     Idle_Priority
                            := Priority_Default_Idle)
        return Idle_Handler_Id;

Register an idle callback with no user data.
procedure Idle_Remove
     (Id                 : in     Idle_Handler_Id);

Remove an idle callback, when its Id is known.
Timeout
-------

A timeout is a function that is called after a specified amount
of time. You can of course use Ada tasks for the same role, however
this might provide an easier way of doing things.

   In case your timeout function takes longer to execute than the
specific  delay (for instance it takes 200ms for an internal of 100ms),
then  no invocation is queued, and they are simply discarded. There is
no  queue of expired timers. On the other hand, standard events are
still  processed, but slowly (since they have the same priority as
timeouts).

   The redrawing and resizing of widgets, which are being done as idles
with lower priority will not take place.

function Timeout_Add
     (Interval           : in     Guint32;
        Func               :        Timeout_Callback)
        return Timeout_Handler_Id;

Add a new timeout. Func will be called after Interval milliseconds.
The function will be as long as it returns True.
procedure Timeout_Remove
     (Id                 : in     Timeout_Handler_Id);

Unregister a timeout function.

File: gtkada_rm.info,  Node: Package_Gtk.Marshallers,  Next: Package_Gtk.Menu,  Prev: Package_Gtk.Main,  Up: Top

Package Gtk.Marshallers
***********************

This package provides a set of generic packages to easily create  some
Marshallers. Although this package has been designed to be  easily
reusable, its primary aim is to simplify the use of callbacks.

   Note that most users don't need to understand or even look at this
package, since the main functions are also renamed in the Gtk.Handlers
package (They are called To_Marshaller). This package is rather
complex (generic packages inside generic packages), and thus you should
understand correctly how Gtk.Handlers work before looking at this one.

   To understand the paradigm used in this package, some definitions
are necessary:

   A Handler, or Callback, is a subprogram provided by the user.
This handler, when attached to a particular object, will be     called
when certain events happen during the life of this     object. All
handlers take as a first argument an access to     the object they were
attached to. Depending on the signal, this     handler can also have
some extra parameters; most of the time,     only one extra parameter
will be used. For more information about     Handlers, refer to the
package Gtk.Handlers, where this notion is     explained in more
details.

   A General_Handler is an access to any Handler. Note that this is
a type used internally, most users should *not* be using it. It is
publicly declared so that users can create new marshallers that
would not be already provided here.

   A Handler_Proxy is a subprogram that calls its associated
handler with the appropriate arguments (from an array of arguments
stored in Gtk.Arguments.Gtk_Args)

   A Marshaller is the association of a General_Handler and a
Handler_Proxy.

   This package is divided in four generic packages. Each package has
been designed to cover a certain kind of callback by providing the
associated marshallers. There are two primary factors that describe  a
callback, and that decide which marshaller to use: Does the  callback
have access to some user data?  Does the callback return  some value?

   Depending on that, the appropriate generic package should be chosen.
For example, if the callback returns a value, but does not expect
user data, then the "Return_Marshallers" package should be used.   More
details about the usage of each package is provided individually  below.

   Each of these packages is in turn divided into three generic
sub-packages.  The organization of these subpackages is always the
same :     o The type "Handler" is defined. It describes the profile of
the       Handler covered in this generic package.      o a
"To_Marshaller" function is provided to build a Marshaller       from
any Handler.      o A "Emit_By_Name" procedure is also provided to
allow the user       to "emit" a signal. This service is explained in
more details in       Gtk.Handlers.      o A private function "Call" is
also defined. This is the actual       Handler_Proxy that will be used
when creating Marshallers with       the "To_Marshaller" service.

   Once again, selecting the right generic sub-package depends on the
callback. For instance, the first sub-package, always called
"Generic_Marshaller", is to be used when the handler has one extra
argument which is a simple non-tagged type. More details about the
usage of each sub-package is also provided individually.

   Although most of the cases are covered by the packages below, some
unusual cases may appear. This is the case for example when the
callback accepts several extra parameters. In such cases, two options
are available: The first option is to use the "standard" callback
mechanism with one parameter, this parameter being an array of
arguments that you will parse yourself. The second option is to  create
a new Marshaller package. This is more interesting if more  than one
callback will follow the same pattern. The body of this  package can be
used as a good model to build such new marshallers.   See also the
example in the GtkAda distribution for how to create your  own
marshallers.

* Menu:


File: gtkada_rm.info,  Node: Package_Gtk.Menu,  Next: Package_Gtk.Menu_Bar,  Prev: Package_Gtk.Marshallers,  Up: Top

Package Gtk.Menu
****************

This widget implements a drop-down menu.   This is basically a simple
box that contains a series of Gtk_Menu_Item  widgets, on which the user
can click to perform actions.

   Such a menu is usually part of a Gtk_Menu_Bar (at the top of the
window),  or activated by clicking on an item in another Gtk_Menu.
*note Package_Gtk.Option_Menu:: for another way of displaying menus.

   All the menus in GtkAda can be "Tear off" menus, i.e you can detach
them from their parent (either a menu bar or another menu) to keep them
visible on the screen at all times).

   It is worth noting that by default, the user of your application
will be  able to dynamically modify the shortcuts associated with each
menu item.   For instance, selecting a menu item and pressing a key
will assign this  new shortcut to the item, possibly removing the
shortcut from any other  item it was associated with.

   Note that pressing <backspace> will simply remove the shortcut.

   This default behavior, somewhat unexpected, can be canceled.   There
are two ways to control this behavior: you can lock a specific menu
item by calling Gtk.Widget.Lock_Accelerators on it. But you can also
lock all the menu items at once by calling Gtk.Accel_Group.Lock for all
the accelerator groups that were used (the GUI builder gate generally
creates a single one), as well as on the group returned by
Gtk.Accel_Group.Get_Default, which is the one used for items that don't
initially have a shortcut.

* Menu:

* Gtk.Menu Widget Hierarchy::
* Gtk.Menu Types::
* Gtk.Menu Subprograms::
* Gtk.Menu Example::


File: gtkada_rm.info,  Node: Gtk.Menu Widget Hierarchy,  Next: Gtk.Menu Types,  Up: Package_Gtk.Menu

Widget Hierarchy
================

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Menu_Shell  (*note Package_Gtk.Menu_Shell::)
                 \___ Gtk_Menu     (*note Package_Gtk.Menu::)


File: gtkada_rm.info,  Node: Gtk.Menu Types,  Next: Gtk.Menu Subprograms,  Prev: Gtk.Menu Widget Hierarchy,  Up: Package_Gtk.Menu

Types
=====

type Gtk_Menu_Detach_Func is access procedure

type Gtk_Menu_Position_Func is access procedure

