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


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

Types
=====

type Gtk_Anchor_Type is
     (Anchor_Center,
          Anchor_North,
          Anchor_North_West,
          Anchor_North_East,
          Anchor_South,
          Anchor_South_East,
          Anchor_South_West,
          Anchor_West,
          Anchor_East);

Gtk_Anchor_Type indicates the exact location of the widget on its
side. Note that not all anchors are relevant for each side.    For
instance, if you put a widget on Side_Right, with an anchor of
Anchor_North, Anchor_North_West or Anchor_North_East, the widget will
in fact appear on the upper right side of the remaining space in the
container.    Thus, if a previous child was added on Side_North, then
the new child  will only appear on the second line in the container.
The order the  children are inserted into the container is important.
type Gtk_Packer_Child is new Gdk.C_Proxy;

A child of the packer.   It includes both the widget and its position
in the packer.
type Gtk_Packer_Options is new Guint;

Indicate how the child should fill its allocated area.    If
Gtk_Pack_Expand is set, the child allocated area is expanded to  occupy
the whole width (or height) or the Package. The orientation  depends on
the side of the child (if Top or Bottom, the expansion  is done
vertically, otherwise it is done horizontally).    If Gtk_Fill_X or
Gtk_Fill_Y is set, the child is resized till it  occupies all the area
allocated to it.   If the side of the widget is top or bottom, the
widget can always  be filled horizontally with Gtk_Fill_X (and will
thus be as wide as  the Gtk_Packer itself. However, it can be filled
vertically with  Gtk_Fill_Y only if Gtk_Pack_Expand is set.
type Gtk_Side_Type is
     (Side_Top,
          Side_Bottom,
          Side_Left,
          Side_Right);

Gtk_Side_Type indicates on which the widget should be inserted.   The
children are displayed in the order they were inserted into the
container.   Each time a child is displayed, the available space for
the remaining  child is restrained. For instance, every time you put a
child on the  Side_Top or Side_Bottom, the available space is decreased
so that no  other widget is inserted in the same line.    For instance,
if you put two widgets on Side_Top, the second one will  appear below
the first one. If you add two widgets on Side_Right, the  second one
will be placed on the left of the first.

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

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

Modifying the Packer
--------------------

procedure Gtk_New
     (Widget             : out    Gtk_Packer);

Create a new empty packer.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Packer.
procedure Add_Defaults
     (Packer             : access Gtk_Packer_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Side               : in     Gtk_Side_Type;
        Anchor             : in     Gtk_Anchor_Type;
        Options            : in     Gtk_Packer_Options);

Add a new child in the container, with default values for its border
width and its padding.   See Gtk_Size_Type, Gtk_Anchor_Type and
Gtk_Packer_Options above for  more information on these types.
procedure Add
     (Packer             : access Gtk_Packer_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Side               : in     Gtk_Side_Type;
        Anchor             : in     Gtk_Anchor_Type;
        Options            : in     Gtk_Packer_Options;
        Border_Width       : in     Guint;
        Pad_X              : in     Guint;
        Pad_Y              : in     Guint;
        I_Pad_X            : in     Guint;
        I_Pad_Y            : in     Guint);

Add a new child in the container.
See Gtk_Size_Type, Gtk_Anchor_Type and Gtk_Packer_Options above for
more information on these types.

   Border_Width is the space left on each side of the child.   Pad_X is
additional space left on each horizontal side of the child     when it
is not centered (the anchor is NE, E, NW, SW, W, SE)  Pad_Y is
additional space left on each vertical side of the child     when it is
not centered (the anchor is NW, N, NE, SE, S, SW)  I_Pad_X is
additional space left on each horizontal side of the     child when it
is on the borders (anchor is N, Center, S)  I_Pad_Y is additional space
left on each vertical side of the     child when it is on the borders
(anchor is E, Center, W)
procedure Set_Child_Packing
     (Packer             : access Gtk_Packer_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Side               : in     Gtk_Side_Type;
        Anchor             : in     Gtk_Anchor_Type;
        Options            : in     Gtk_Packer_Options;
        Border_Width       : in     Guint;
        Pad_X              : in     Guint;
        Pad_Y              : in     Guint;
        I_Pad_X            : in     Guint;
        I_Pad_Y            : in     Guint);

Change the packing options for Child.
See the documentation for Add above for more information on the
parameters.   Nothing is done if Child is not contained in Packer.
procedure Reorder_Child
     (Packer             : access Gtk_Packer_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Position           : in     Gint);

Change the position of the child in the list of children.
As seen in the explanation of the packing parameters, the order of  the
children is important, since each child inserted limits the space
available to the next children in the list.
procedure Set_Default_Border_Width
     (Packer             : access Gtk_Packer_Record;
        Border             : in     Guint);

Modify the default border width for all the children of Packer.
This is the border_width that is used by Add_Defaults above.   Its
default value is 0.
procedure Set_Default_Ipad
     (Packer             : access Gtk_Packer_Record;
        I_Pad_X            : in     Guint;
        I_Pad_Y            : in     Guint);

Set the default Ipadding for all the children of Packer.
This is the value used by Add_Defaults above.   The default values are
0.
procedure Set_Default_Pad
     (Packer             : access Gtk_Packer_Record;
        Pad_X              : in     Guint;
        Pad_Y              : in     Guint);

Set the default Padding for all the children of Packer.
This is the value used by Add_Defaults above.   The default values are
0.
Accessing children
------------------

Some functions give access to the children of a Gtk_Packer.
You can not use the standard Gtk.Container.Children function as is,
since the children are not exactly widgets but more complicated
structures. In C, one would use a direct access to the fields of  the
packer, and then do some type-casting, which is what we are  trying to
avoid in Ada.

function Find_Child
     (Packer             : access Gtk_Packer_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class)
        return Gtk_Packer_Child;

Return the child of Packer that is associated with the widget Child.
Null_Packer_Child will be returned if Child is not contained in Packer.
function Get_Nth_Child
     (Packer             : access Gtk_Packer_Record;
        N                  :        Guint)
        return Gtk_Packer_Child;

Returns the Nth child of the packer.
The first child is found at index 1.   Null_Packer_Child will be
returned if there is no such child in Packer.
function Get_Anchor
     (Child              :        Gtk_Packer_Child)
        return Gtk_Anchor_Type;

Return the Anchor type for the child.
function Get_Side
     (Child              :        Gtk_Packer_Child)
        return Gtk_Side_Type;

Return the side of the child.
function Get_Options
     (Chlid              :        Gtk_Packer_Child)
        return Gtk_Packer_Options;

Return the options set for the child.
function Get_Border_Width
     (Child              :        Gtk_Packer_Child)
        return Guint;

Return the border width for the child.
function Get_Pad_X
     (Child              :        Gtk_Packer_Child)
        return Guint;

Return the X padding for the child (when on the borders).
function Get_Pad_Y
     (Child              :        Gtk_Packer_Child)
        return Guint;

Return the Y padding for the child (when on the borders).
function Get_I_Pad_X
     (Child              :        Gtk_Packer_Child)
        return Guint;

Return the X i_padding for the child (when not on the borders).
function Get_I_Pad_Y
     (Child              :        Gtk_Packer_Child)
        return Guint;

Return the Y i_padding for the child (when not on the borders).

File: gtkada_rm.info,  Node: Package_Gtk.Paned,  Next: Package_Gtk.Plug,  Prev: Package_Gtk.Packer,  Up: Top

Package Gtk.Paned
*****************

A Gtk_Paned is a container that organizes its two children either
horizontally or vertically.   The initial size allocated to the
children depends on the size  they request. However, the user has the
possibility to interactively  move a separation bar between the two to
enlarge one of the children,  while at the same time shrinking the
second one.   The bar can be moved by clicking with the mouse on a
small cursor  displayed in the bar, and then dragging the mouse.

   No additional decoration is provided around the children.

   Each child has two parameters, Resize and Shrink.

   If Shrink is True, then the widget can be made smaller than its
requisition size by the user. Set this to False if you want to  set a
minimum size.

   if Resize is True, this means that the child accepts to be resized,
and  will not require any size. Thus, the size allocated to it will be
the total size allocated to the container minus the size requested by
the other child.   If Resize is False, the child should ask for a
specific size, which it  will get. The other child will be resized
accordingly.   If both Child have the same value for Resize (either
True or False), then  the size allocated to each is a ratio between the
size requested by both.

   When you use Set_Position with a parameter other than -1, or the user
moves the handle to resize the widgets, the behavior of Resize is
canceled.

* Menu:

* Gtk.Paned Widget Hierarchy::
* Gtk.Paned Subprograms::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Paned       (*note Package_Gtk.Paned::)


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

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

procedure Gtk_New_Vpaned
     (Widget             : out    Gtk_Paned);

Create a new vertical container.
The children will be displayed one on top of the other.
procedure Gtk_New_Hpaned
     (Widget             : out    Gtk_Paned);

Create a new horizontal container.
The children will be displayed one besides the other.
procedure Initialize_Vpaned
     (Widget             : access Gtk_Paned_Record'Class);

Internal initialization function.
See the section "Creating your own widgets" in the documentation.
procedure Initialize_Hpaned
     (Widget             : access Gtk_Paned_Record'Class);

Internal initialization function.
See the section "Creating your own widgets" in the documentation.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Paned.
function Get_Type_Vpaned       return Gtk.Gtk_Type;

Return the internal value associated with a vertical Gtk_Paned.
function Get_Type_Hpaned       return Gtk.Gtk_Type;

Return the internal value associated with a horizontal Gtk_Paned.
procedure Add1
     (Paned              : access Gtk_Paned_Record;
        Child              : access Gtk_Widget_Record'Class);

Add the first child of the container.
The child will be displayed either in the top or in the left pane,
depending on the orientation of the container.   This is equivalent to
using the Pack1 procedure with its default  parameters.
procedure Pack1
     (Paned              : access Gtk_Paned_Record;
        Child              : access Gtk_Widget_Record'Class;
        Resize             : in     Boolean := False;
        Shrink             : in     Boolean := True);

Add a child to the top or left pane.
You can not change dynamically the attributes Resize and Shrink.
Instead, you have to remove the child from the container, and put it
back with the new value of the attributes. You should also first  call
Gtk.Object.Ref on the child so as to be sure it is not destroyed  when
you remove it, and Gtk.Object.Unref it at the end. See the  example in
testgtk/ in the GtkAda distribution.
procedure Add2
     (Paned              : access Gtk_Paned_Record;
        Child              : access Gtk_Widget_Record'Class);

Add the second child of the container.
It will be displayed in the bottom or right pane, depending on the
container's orientation.   This is equivalent to using Pack2 with its
default parameters.
procedure Pack2
     (Paned              : access Gtk_Paned_Record;
        Child              : access Gtk_Widget_Record'Class;
        Resize             : in     Boolean := False;
        Shrink             : in     Boolean := False);

Add a child to the bottom or right pane.
procedure Set_Position
     (Paned              : access Gtk_Paned_Record;
        Position           :        Gint);

Change the position of the separator.
If position is negative, the remembered position is forgotten,  and the
division is recomputed from the requisitions of the  children.
Position is in fact the size (either vertically or horizontally,
depending on the container) set for the first child.
procedure Set_Handle_Size
     (Paned              : access Gtk_Paned_Record;
        Size               :        Guint16);

Set the handle size to Size x Size pixels.
This is the small handle that the user has to drag to resize the  panes.
function Get_Handle_Size
     (Paned              : access Gtk_Paned_Record)
        return Guint16;

Return the current size in pixels of the handle.
procedure Set_Gutter_Size
     (Paned              : access Gtk_Paned_Record;
        Size               : in     Guint16);

Set the width in pixels of the gutter.
This is the area between the two panes.
function Get_Gutter_Size
     (Paned              : access Gtk_Paned_Record)
        return Guint16;

Return the width in pixels of the gutter.
function Get_Child1
     (Paned              : access Gtk_Paned_Record)
        return Gtk.Widget.Gtk_Widget;

Return the child displayed in the top or left pane.
function Get_Child2
     (Paned              : access Gtk_Paned_Record)
        return Gtk.Widget.Gtk_Widget;

Return the child displayed in the bottom or right pane.
function Get_Child1_Resize
     (Paned              : access Gtk_Paned_Record)
        return Boolean;

Get the value of the resize attribute for the first child.
function Get_Child2_Resize
     (Paned              : access Gtk_Paned_Record)
        return Boolean;

Get the value of the resize attribute for the second child.
function Get_Child1_Shrink
     (Paned              : access Gtk_Paned_Record)
        return Boolean;

Get the value of the shrink attribute for the first child.
function Get_Child2_Shrink
     (Paned              : access Gtk_Paned_Record)
        return Boolean;

Get the value of the shrink attribute for the second child.

File: gtkada_rm.info,  Node: Package_Gtk.Plug,  Next: Package_Gtk.Radio_Button,  Prev: Package_Gtk.Paned,  Up: Top

Package Gtk.Plug
****************

Note that this package is currently not supported under Win32 systems.

   Together with Gtk_Socket, Gtk_Plug provides the ability to embed
widgets  from one process into another process in a fashion that is
transparent to  the user. One process creates a Gtk_Socket widget and,
passes the XID of  that widgets window to the other process, which then
creates a Gtk_Plug  window with that XID.   Any widgets contained in
the Gtk_Plug then will appear inside the first  applications window.

* Menu:

* Gtk.Plug Widget Hierarchy::
* Gtk.Plug Subprograms::


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

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_Window   (*note Package_Gtk.Window::)
                    \___ Gtk_Plug  (*note Package_Gtk.Plug::)


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

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

procedure Gtk_New
     (Widget             : out    Gtk_Plug;
        Socket_Id          : in     Guint32);

Create a new plug widget inside the Gtk_Socket identified by socket_id.
Socket_Id is the XID of the socket's window.

File: gtkada_rm.info,  Node: Package_Gtk.Radio_Button,  Next: Package_Gtk.Scrolled_Window,  Prev: Package_Gtk.Plug,  Up: Top

Package Gtk.Radio`_'Button
**************************

A Gtk_Radio_Button is a simple button that has two states, like a
Gtk_Toggle_Button.   However, Gtk_Radio_Buttons can be grouped together
to get a special  behavior: only one button in the group can be active
at any given time.   Thus, when the user selects one of the buttons
from the group, the button  that was previously selected is disabled.

   The radio buttons always belongs to a group, even if there is only
one in  this group

* Menu:

* Gtk.Radio_Button Widget Hierarchy::
* Gtk.Radio_Button Subprograms::
* Gtk.Radio_Button Example::


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

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_Button   (*note Package_Gtk.Button::)
                    \___ Gtk_Toggle_Button (*note Package_Gtk.Toggle_Button::)
                       \___ Gtk_Check_Button (*note Package_Gtk.Check_Button::)
                          \___ Gtk_Radio_Button (*note Package_Gtk.Radio_Button::)


File: gtkada_rm.info,  Node: Gtk.Radio_Button Subprograms,  Next: Gtk.Radio_Button Example,  Prev: Gtk.Radio_Button Widget Hierarchy,  Up: Package_Gtk.Radio_Button

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

procedure Gtk_New
     (Radio_Button       : out    Gtk_Radio_Button;
        Group              : in     Widget_SList.GSlist
                            := Widget_SList.Null_List;
        Label              : in     String := "");

Create a new radio button, belonging to Group.
If Label is left as the empty string, then the button will not have any
child and you are free to put any thing you want in it, including a
pixmap.   To initialize the group (when creating the first button),
leave Group  to the Null_List. You can later get the new group that is
created with  a call to the Group subprogram below.
procedure Gtk_New
     (Radio_Button       : out    Gtk_Radio_Button;
        Group              : in     Gtk_Radio_Button;
        Label              : in     String := "");

Create a new radio button in the same group as Group.
If Label is left as the empty string, Radio_Button is created without
any child and you can put whatever you want in it, including a pixmap.

   To initialize a new group (when creating the first button), you
should  pass it null or a button that has not been created with
Gtk_New, as in  the example below.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Radio_Button.
function Group
     (Radio_Button       : access Gtk_Radio_Button_Record)
        return Widget_SList.GSlist;

Return the group to which Radio_Button belongs.
This can be used as an argument to the first version of Gtk_New above,
or the list can also be traversed to get all the buttons.
procedure Set_Group
     (Radio_Button       : access Gtk_Radio_Button_Record;
        Group              : in     Widget_SList.GSlist);

Modify the group to which the button belongs.
This will not change anything visually.

File: gtkada_rm.info,  Node: Gtk.Radio_Button Example,  Prev: Gtk.Radio_Button Subprograms,  Up: Package_Gtk.Radio_Button

Example
=======

      --  This creates a group of two buttons. Note how the group is initialized.
     
      declare
         Radio_Button : Gtk_Radio_Button;
      begin
         Gtk_New (Radio_Button,
                  Group       => Radio_Button,
                  Label       => "First button");
         Gtk_New (Radio_Button,
                  Group       => Radio_Button,
                  Label       => "Second button");
      end;


File: gtkada_rm.info,  Node: Package_Gtk.Scrolled_Window,  Next: Package_Gtk.Selection,  Prev: Package_Gtk.Radio_Button,  Up: Top

Package Gtk.Scrolled`_'Window
*****************************

Gtk_Scrolled_Window is a Gtk_Bin child: it's a container the accepts a
single child widget. Gtk_Scrolled_Window adds scrollbars to the child
widget.

   The scrolled window can work in two ways. Some widgets have native
scrolling support; these widgets have "slots" for Gtk_Adjustment
objects.   The scrolled window installs Gtk_Adjustment objects in the
child window's  slots using the "set_scroll_adjustments" signal
(Conceptually, these  widgets implement a "Scrollable" interface).

   The second way to use the scrolled window is useful with widgets
that lack  the "set_scroll_adjustments" signal. The Gtk_Viewport widget
acts as a  proxy, implementing scrollability for child widgets that
lack their own  scrolling capabilities.

   If a widget has native scrolling abilities, it can be added to the
Gtk_Scrolled_Window with Gtk.Container.Add. If a widget does not, you
must  first add the widget to a Gtk_Viewport, then add the Gtk_Viewport
to the  scrolled window. The convenience function Add_With_Viewport
does exactly  this, so you can ignore the presence of the viewport.

   If you want to create your own new widget type that can be inserted
directly into a scrolled_window, you need to specify a signal for
Set_Scroll_Adjustments in the call to
Gtk.Object.Initialize_Class_Record.

* Menu:

* Gtk.Scrolled_Window Widget Hierarchy::
* Gtk.Scrolled_Window Types::
* Gtk.Scrolled_Window Subprograms::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Scrolled_Window (*note Package_Gtk.Scrolled_Window::)


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

Types
=====

type Gtk_Corner_Type is
     (Corner_Top_Left,
          Corner_Bottom_Left,
          Corner_Top_Right,
          Corner_Bottom_Right);

Type used by Set_Placement below to determine the location of the
child widget with respect to the scrollbars.   Corner_Top_Left means
the child is in the top left, with the scrollbars  underneath and to
the right.

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

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

procedure Gtk_New
     (Scrolled_Window    : out    Gtk_Scrolled_Window;
        Hadjustment        :        Adjustment.Gtk_Adjustment
                            := Adjustment.Null_Adjustment;
        Vadjustment        :        Adjustment.Gtk_Adjustment
                            := Adjustment.Null_Adjustment);

Create a new scrolled window.
The two arguments are the scrolled window's horizontal and vertical
adjustments; these will be shared with the scrollbars and the child
widget to keep the bars in sync with the child. Usually you want to use
the default value Null_Adjustment for the adjustments, which will cause
the scrolled window to create them for you.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Scrolled_Window.
procedure Add_With_Viewport
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class);

Used to add children without native scrolling capabilities.
This is simply a convenience function; it is equivalent to adding the
unscrollable child to a viewport, then adding the viewport to the
scrolled window. If a child has native scrolling, use Gtk.Container.Add
instead of this function.

   The viewport scrolls the child by moving its Gdk_Window, and takes
the  size of the child to be the size of its toplevel Gdk_Window. This
will  be very wrong for most widgets that support native scrolling; for
example, if you add a Gtk_Clist with a viewport, the whole widget will
scroll, including the column headings. Thus Gtk_Clist supports
scrolling  already, and should not be used with the GtkViewport proxy.

   A widget supports scrolling natively if it contains a valid
"set_scroll_adjustments" signal.
function Get_Hadjustment
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record)
        return Adjustment.Gtk_Adjustment;

Return the horizontal scrollbar's adjustment.
This adjustment is used to connect the horizontal scrollbar to the child
widget's horizontal scroll functionality.
function Get_Vadjustment
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record)
        return Adjustment.Gtk_Adjustment;

Return the vertical scrollbar's adjustment.
This adjustment is used to connect the vertical scrollbar to the child
widget's vertical scroll functionality.
procedure Set_Hadjustment
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record;
        Hadjustment        :        Adjustment.Gtk_Adjustment);

Set the Gtk_Adjustment for the horizontal scrollbar.
procedure Set_Vadjustment
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record;
        Vadjustment        :        Adjustment.Gtk_Adjustment);

Set the Gtk_Adjustment for the vertical scrollbar.
procedure Set_Placement
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record;
        Window_Placement   :        Gtk_Corner_Type);

Determine the location of the widget with respect to the scrollbars.
The default is Corner_Top_Left.
procedure Set_Policy
     (Scrolled_Window    : access Gtk_Scrolled_Window_Record;
        H_Scrollbar_Policy  : in     Enums.Gtk_Policy_Type;
        V_Scrollbar_Policy  : in     Enums.Gtk_Policy_Type);

Set the scrollbar policy for the horizontal and vertical scrollbars.
It determines when the scrollbar should appear; it is a value  from the
Gtk_Policy_Type enumeration. If Policy_Always, the scrollbar is  always
present; if Policy_Never, the scrollbar is never present; if
Policy_Automatic, the scrollbar is present only if needed (that is, if
the slider part of the bar would be smaller than the trough - the
display is larger than the page size).

File: gtkada_rm.info,  Node: Package_Gtk.Selection,  Next: Package_Gtk.Signal,  Prev: Package_Gtk.Scrolled_Window,  Up: Top

Package Gtk.Selection
*********************

This package implements support for the selection mechanism (ie a way to
get a currently active selection anywhere on your Xserver or on your
Windows machine).

   This also acts as the low-level support for drag-and-drop, as
described  in Gtk.Dnd.

   A lot of subprograms in this package work on Gdk_Atom types, instead
of  strings. Converting from one to the other can easily be done through
calls to the subprograms in Gdk.Property (Atom_Intern and Atom_Name).
The reason we use Gdk_Atom is for efficiency, since comparing two
integers  is of course faster than comparing two strings.

   The selection mechanism is the primary mechanism by which
applications  can transfer data to each other on a given system. Even
though both  applications must be visible on the same screen, this does
not mean that  they can access the same files or ressources, since they
might in fact  be running on different machines. You should always keep
this in mind  when setting the data to be transfered.

   A selection is a essentially a named clipboard, identified by a
string  interned as a Gdk_Atom. By claiming ownership of a selection, an
application indicates that it will be responsible for supplying its
contents.

   The contents of a selection can be represented in a number of
formats,  called targets. Each target is identified by an atom. A list
of all  possible targets supported by the selection owner can be
retrieved by  requesting the special target TARGETS. When a selection
is retrieved, the  data is accompanied by a type (an atom), and a
format (an integer,  representing the number of bits per item).

* Menu:

* Gtk.Selection Signals::
* Gtk.Selection Types::
* Gtk.Selection Subprograms::


File: gtkada_rm.info,  Node: Gtk.Selection Signals,  Next: Gtk.Selection Types,  Up: Package_Gtk.Selection

Signals
=======

   * "selection_get"

     procedure Handler (Widget : access Gtk_Widget_Record'Class;
     Data   : Selection_Data;
     Info   : Guint;
     Time   : Guint);
     This signal is sent to the owner of a selection whenever some other
     widget wants to get data from that selection. The type of the data
     is indicated in Info, and is the third field that was set in the
     Target_Entrys for that specific widget and selection.

     The handler should modify the Data in the selection.

   * "selection_received"

     procedure Handler (Widget : access Gtk_Widget_Record'Class;
     Data   : Selection_Data;
     Time   : Guint);
     This signal is sent to the receiver end of a selection, when the
     data has been sent by the owner. The receiver should call Convert,
     which will emit the signal selection_get to ask for the contents
     of the selection, and then selection_received will be emitted to
     warn the receiver.

     Note: you can not connect this signal to a widget that does not
     have an associated Gdk_Window (i.e the flag Gtk.Widget.No_Window
     must not be set for this widget), since it needs to be able to
     receive Property_Notify events from the server. It will not work
     with a Gtk_Label for instance.



File: gtkada_rm.info,  Node: Gtk.Selection Types,  Next: Gtk.Selection Subprograms,  Prev: Gtk.Selection Signals,  Up: Package_Gtk.Selection

Types
=====

subtype Gdk_Selection is Gdk.Types.Gdk_Atom;

These are predefined atom values for several common selections.   You
are of course free to create new ones, but most of the time you  should
simply use Selection_Primary unless you foresee the need for  multiple
simultaneous selections.   To access the clipboard on windows machines,
you might need to create  a new selection with Gdk.Property.Atom_Intern
("CLIPBOARD");
subtype Gdk_Selection_Type is Gdk.Types.Gdk_Atom;

Predefined atom values for selection types.   Although the preferred
way in GtkAda to indicate the type of a selection  is to use mime
types, these values are provided for compatibility with  older X11
applications.
subtype Gdk_Target is Gdk.Types.Gdk_Atom;

Predefined atom values which are used to describe possible targets for
a selection. Other atoms can be used, and the recommended practice for
GtkAda is to to use mime types for this purpose. However, supporting
these types may be useful for compatibility with older programs.
type Selection_Data is new Gdk.C_Proxy;

Contents of a selection or a drag-and-drop operation.   This structure
can only be created internally by GtkAda. However, you  need to be able
to access it to get the selection.   - Selection and Target identify
the request.   - Type specifies the type of the return.   - if Length
is negative, the Data should be ignored. Otherwise, it  contains the
data itself.   - Time gives the timestamp at which the data was sent.
type Target_Entry is record
     Target : Gtkada.Types.Chars_Ptr;
         Flags  : Target_Flags;
         Info   : Guint;
         end record;

A single type of data that can be supplied or received during a
drag-and-drop or a selection.    Target is a string that represents the
drag type. This can be any  string if you want to implement
drag-and-drop inside your application.   However, if you want to
communicate with other external application,  you should use MIME
types, ie "text/plain", "text/uri-list", ...   See the RFCs 2045, 2046,
2047, 2048, 2049 for more information on  MIME types.    For more
information, see
ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/   Another set
of supported names are the ones associated with the X  Inter-Client
Communications Conventions Manual (ICCCM).   Here some of the default
names and their meaning. See the ICCCM manual  online for a complete
list (for instance at  http://www.tronche.com/gui/x/icccm/).    -
"TIMESTAMP"   (type Integer)  Timestamp used to acquire the selection
- "TEXT"        (type Text)     Text in owner's encoding  - "STRING"
 (type String)   Iso Latin1 text  - "PIXMAP"      (type Drawable)
Pixmap Id  - "BITMAP"      (type Bitmap)   Bitmap Id  - "FOREGROUND"
(type Pixel)    Pixel Value  - "BACKGROUND"  (type Pixel)    Pixel Value
 Info is an application-assigned integer (i.e. that you choose), that
will be passed as a signal parameter for all the dnd-related signals,
like "selection_get". This saves a lot of expensive string compares,
and in fact replaced Target everywhere in your application expect in
Source_Set and Dest_Set.
type Target_Entry_Array is array (Natural range <>) of Target_Entry;

type Target_Flags is new Integer;

Used to specify constraints on an entry
type Target_List is new Gdk.C_Proxy;

A list of targets.   You can only manipulate this list through the
functions below.

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

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

Target_List
-----------

function Target_List_New
     (Targets            : in     Target_Entry_Array)
        return Target_List;

Create a new list of target, starting from an array.
procedure Target_List_Ref
     (List               : in     Target_List);

Increment the reference count for the list.
You should almost never have to use this function, this is done
transparently by GtkAda.
procedure Target_List_Unref
     (List               : in     Target_List);

Decrement the reference count for the list.
You should almost never have to use this function, since everything is
done transparently by GtkAda.   As usual, the list is freed when the
reference count reaches 0.
procedure Target_List_Add
     (List               : in     Target_List;
        Target             : in     Gdk.Types.Gdk_Atom;
        Flags              : in     Guint;
        Info               : in     Guint);

Add a new target to the list.
You can for instance use the result of Get_Targets (Drag_Context) for
the value of Target.
procedure Target_List_Add_Table
     (List               : in     Target_List;
        Targets            : in     Target_Entry_Array);

Add a new set of targets to the list.
procedure Target_List_Remove
     (List               : in     Target_List;
        Target             : in     Gdk.Types.Gdk_Atom);

Remove a specific target from the list.
procedure Target_List_Find
     (List               : in     Target_List;
        Target             : in     Gdk.Types.Gdk_Atom;
        Info               : out    Guint;
        Found              : out    Boolean);

Search for a specific target in the list.
If the target was found, Found is set to True and Info contains the
integer that was associated with the target when it was created.
Selection_Data
--------------

function Get_Selection
     (Selection          : in     Selection_Data)
        return Gdk_Selection;

Return the selection used (primary, clipboard, ...)
function Get_Target
     (Selection          : in     Selection_Data)
        return Gdk.Types.Gdk_Atom;

Return the target of the selection (ie a MIME string that identifies
the selection).
function Get_Type
     (Selection          : in     Selection_Data)
        return Gdk.Types.Gdk_Atom;

Return the type of the selection, as defined in Gdk_Selection_Type,
ie for compatibility with older X11 applications.
function Get_Format
     (Selection          : in     Selection_Data)
        return Gint;

Return the format of the data.
The semantics depends on the type of data. For instance, for strings
this is the number of bits per character.
function Get_Data
     (Selection          : in     Selection_Data)
        return System.Address;

Return the data of the selection.
This should be ignored if Get_Length returns a value < 0.
function Get_Data_As_String
     (Selection          : in     Selection_Data)
        return String;

Return the data as a string.
This is only a convenience function, since it simply creates a string
from the return of Get_Data.
function Get_Length
     (Selection          : in     Selection_Data)
        return Gint;

Return the length of the data.
procedure Selection_Data_Set
     (Selection          : in     Selection_Data;
        The_Type           : in     Gdk.Types.Gdk_Atom;
        Format             : in     Gint;
        Data               : in     System.Address;
        Length             : in     Gint);

General form of Selection_Data_Set.
Any data can be transmitted. Length is the number of bytes in Data.
procedure Selection_Data_Set
     (Selection          : in     Selection_Data;
        The_Type           : in     Gdk.Types.Gdk_Atom;
        Format             : in     Gint;
        Data               : in     String);

Set the data for a selection (special case for strings)
This function is generally called when a drag-and-drop operation  ask
the source widget for the data to be transmitted. In that case,  a
Selection_Data was already transmitted and is given as a handler
parameter for the signal "drag_data_get". The_Type can simply be
extracted from the Selection_Data.
function Selection_Data_Copy
     (Selection          : in     Selection_Data)
        return Selection_Data;

Make a copy of a selection data.
procedure Selection_Data_Free
     (Selection          : in     Selection_Data);

Free a Selection_Data structure returned from Selection_Data_Copy.
Manipulating the selection
--------------------------

function Owner_Set
     (Widget             : in     Gtk.Widget.Gtk_Widget;
        Selection          : in     Gdk_Selection
                            := Selection_Primary;
        Time               : in     Guint32 := 0)
        return Boolean;

Claim ownership of a given selection for a particular widget,
or, if widget is null, release ownership of the selection.

   Once a Widget has claimed selection, it is responsible for delivering
the data whenever it is needed.

   Time is the timestamp for claiming the selection (default is the
current  time).   This function returns True if the operation succeeded.
procedure Add_Target
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class;
        Selection          : in     Gdk_Selection;
        Target             : in     Gdk.Types.Gdk_Atom;
        Info               : in     Guint);

Add specified target to the list of supported targets for a given
widget and selection.   Info is an integer which will be passed back to
the application instead  of a string when the target is used.
procedure Add_Targets
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class;
        Selection          : in     Gdk_Selection;
        Targets            : in     Target_Entry_Array);

Add a set of targets to the list of supported targets for a given widget
and selection.
function Convert
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class;
        Selection          : in     Gdk_Selection
                            := Selection_Primary;
        Target             : in     Gdk.Types.Gdk_Atom;
        Time               : in     Guint32 := 0)
        return Boolean;

Request the contents of a selection.
When received, a "selection_received" signal will be generated, and the
widget needs to have a handler for it.

   Target is the form of information desired, for instance an intern
Gdk_Atom whose name is "text/plain", or one of the Gdk_Target values.

   This function returns True if the request succeeded, False if the
request could not be processed, for instance if there was already a
request in process for this widget or this target is not known by the
owner of the selection.

   Widget is the widget which acts as a requestor.
procedure Remove_All
     (Widget             : access Gtk.Widget.Gtk_Widget_Record'Class);

Remove all handlers and unsets ownership of all selections for a widget.
Called when widget is being destroyed. This function will not generally
be called by applications.

File: gtkada_rm.info,  Node: Package_Gtk.Signal,  Next: Package_Gtk.Socket,  Prev: Package_Gtk.Selection,  Up: Top

Package Gtk.Signal
******************

!! Important Note !!   This package is obsolete. It is provided only
for backward compatibility  only, and is known to be missing the
capacity to interface to some specific  types of signals.   Consider
using *note Package_Gtk.Handlers:: and  *note Package_Gtk.Marshallers::
instead.

* Menu:


File: gtkada_rm.info,  Node: Package_Gtk.Socket,  Next: Package_Gtk.Spin_Button,  Prev: Package_Gtk.Signal,  Up: Top

Package Gtk.Socket
******************

Note that this package is currently not supported under Win32 systems.

   Together with Gtk_Plug, Gtk_Socket provides the ability to embed
widgets  from one process into another process in a fashion that is
transparent to  the user. One process creates a Gtk_Socket widget and,
passes the XID of  that widget's window to the other process, which
then creates a Gtk_Plug  window with that XID.   Any widgets contained
in the Gtk_Plug then will appear inside the first  applications window.

   The XID of the socket's window is obtained by using the  XWindow
function provided in this package. Before using  this macro, the socket
must have been realized, and for hence, have been  added to its parent.

   Note that if you pass the XID of the socket to another process that
will  create a plug in the socket, you must make sure that the socket
widget is  not destroyed until that plug is created. Violating this
rule will cause  unpredictable consequences, the most likely
consequence being that the plug  will appear as a separate toplevel
window. You can check if the plug has  been created by examining the
plug_window field of the Gtk_Socket  structure. If this field is
non-NULL, then the plug has been succesfully  created inside of the
socket.

   When GtkAda is notified that the embedded window has been destroyed,
then  it will destroy the socket as well. You should always, therefore,
be  prepared for your sockets to be destroyed at any time when the main
event  loop is running.

   A socket can also be used to swallow arbitrary pre-existing top-level
windows using Steal, though the integration when this is done will not
be  as close as between a Gtk_Plug and a Gtk_Socket. All you need in
that case  is the X11 window identifier for the external process.

   Note that it is recommended that the external window be first hidden
before  being swallowed, so that Gtk.Socket works with most window
managers. If  you start with visible windows, some window managers will
not be able to  correctly merge the two windows (Enlightenment for
instance).

* Menu:

* Gtk.Socket Widget Hierarchy::
* Gtk.Socket Subprograms::
* Gtk.Socket Example::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Socket      (*note Package_Gtk.Socket::)


File: gtkada_rm.info,  Node: Gtk.Socket Subprograms,  Next: Gtk.Socket Example,  Prev: Gtk.Socket Widget Hierarchy,  Up: Package_Gtk.Socket

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

procedure Gtk_New
     (Widget             : out    Gtk_Socket);

Create a new empty GtkSocket.
procedure Steal
     (Socket             : access Gtk_Socket_Record;
        Wid                : in     Guint32);

Reparent a pre-existing toplevel window into a Gtk_Socket.
Wid is the XID of an existing toplevel window.
function Get_Plug_Window
     (Socket             : access Gtk_Socket_Record)
        return Gdk.Window.Gdk_Window;

Return the id of the embedded window.
function Get_XWindow
     (Window             :        Gdk.Window.Gdk_Window)
        return Guint32;

Return the X window associated with a Gdk_Window, 0 under Win32.

File: gtkada_rm.info,  Node: Gtk.Socket Example,  Prev: Gtk.Socket Subprograms,  Up: Package_Gtk.Socket

Example
=======

      Obtaining the XID of a socket
     
      with Gtk.Socket;
      use Gtk.Socket;
     
      Socket : Gtk_Socket;
     
      Gtk_New (Socket);
      Show (Socket);
      Add (Parent, Socket);
     
      --  The following call is only necessary if one of
      --  the ancestors of the socket is not yet visible.
     
      Realize (Socket);
      Put_Line ("The XID of the sockets window is" &
                Guint32'Image (Get_XWindow (Get_Window (Socket))));


File: gtkada_rm.info,  Node: Package_Gtk.Spin_Button,  Next: Package_Gtk.Status_Bar,  Prev: Package_Gtk.Socket,  Up: Top

Package Gtk.Spin`_'Button
*************************

A Gtk_Spin_Button is a single line text editing widget for text that
represents a number. At the right hand side of the text line there are
small up- and down arrow buttons for incrementing or decrementing
(spinning) the number within a given range.   It allows the value to
have zero or a number of decimal places and  to be
incremented/decremented in configurable steps.   The action of holding
down one of the buttons optionally results in an  acceleration of
change in the value according to how long it is  depressed.

   *note Package_Gtk.GEntry:: for a text editing widget without spin
buttons.

* Menu:

* Gtk.Spin_Button Widget Hierarchy::
* Gtk.Spin_Button Subprograms::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Editable       (*note Package_Gtk.Editable::)
              \___ Gtk_Entry       (*note Package_Gtk.GEntry::)
                 \___ Gtk_Spin_Button (*note Package_Gtk.Spin_Button::)

