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


File: gtkada_rm.info,  Node: Top,  Up: (dir)

GtkAda Reference Manual
***********************

* Menu:

* Package_Gdk::
* Package_Gdk.Art::
* Package_Gdk.Art.Pixbuf::
* Package_Gdk.Bitmap::
* Package_Gdk.Color::
* Package_Gdk.Color_Context::
* Package_Gdk.Cursor::
* Package_Gdk.Drawable::
* Package_Gdk.Event::
* Package_Gdk.Font::
* Package_Gdk.GC::
* Package_Gdk.Main::
* Package_Gdk.Pixbuf::
* Package_Gdk.Pixmap::
* Package_Gdk.Rgb::
* Package_Gdk.Threads::
* Package_Glade::
* Package_Glade.XML::
* Package_Glade_XML::
* Package_Glib::
* Package_Glib.GSlist::
* Package_Glib.Glist::
* Package_Glib.Module::
* Package_Glib.XML::
* Package_Gtk::
* Package_Gtk.Accel_Label::
* Package_Gtk.Adjustment::
* Package_Gtk.Alignment::
* Package_Gtk.Arguments::
* Package_Gtk.Arrow::
* Package_Gtk.Aspect_Frame::
* Package_Gtk.Bin::
* Package_Gtk.Box::
* Package_Gtk.Button::
* Package_Gtk.Button_Box::
* Package_Gtk.Calendar::
* Package_Gtk.Check_Button::
* Package_Gtk.Check_Menu_Item::
* Package_Gtk.Clist::
* Package_Gtk.Color_Selection::
* Package_Gtk.Color_Selection_Dialog::
* Package_Gtk.Combo::
* Package_Gtk.Container::
* Package_Gtk.Ctree::
* Package_Gtk.Curve::
* Package_Gtk.Data::
* Package_Gtk.Dialog::
* Package_Gtk.Dnd::
* Package_Gtk.Drawing_Area::
* Package_Gtk.Editable::
* Package_Gtk.Event_Box::
* Package_Gtk.Extra::
* Package_Gtk.Extra.Border_Combo::
* Package_Gtk.Extra.Check_Item::
* Package_Gtk.Extra.Color_Combo::
* Package_Gtk.Extra.Combo_Box::
* Package_Gtk.Extra.Font_Combo::
* Package_Gtk.Extra.Item_Entry::
* Package_Gtk.Extra.Plot::
* Package_Gtk.Extra.Plot_3D::
* Package_Gtk.Extra.Plot_Bar::
* Package_Gtk.Extra.Plot_Box::
* Package_Gtk.Extra.Plot_Canvas::
* Package_Gtk.Extra.Plot_Data::
* Package_Gtk.Extra.Plot_Polar::
* Package_Gtk.Extra.Plot_Ps::
* Package_Gtk.Extra.Plot_Surface::
* Package_Gtk.Extra.PsFont::
* Package_Gtk.Extra.Sheet::
* Package_Gtk.File_Selection::
* Package_Gtk.Fixed::
* Package_Gtk.Font_Selection::
* Package_Gtk.Font_Selection_Dialog::
* Package_Gtk.Frame::
* Package_Gtk.GEntry::
* Package_Gtk.GLArea::
* Package_Gtk.Gamma_Curve::
* Package_Gtk.Handle_Box::
* Package_Gtk.Handlers::
* Package_Gtk.Hbutton_Box::
* Package_Gtk.Image::
* Package_Gtk.Item::
* Package_Gtk.Label::
* Package_Gtk.Layout::
* Package_Gtk.Main::
* Package_Gtk.Marshallers::
* Package_Gtk.Menu::
* Package_Gtk.Menu_Bar::
* Package_Gtk.Menu_Item::
* Package_Gtk.Menu_Shell::
* Package_Gtk.Misc::
* Package_Gtk.Notebook::
* Package_Gtk.Object::
* Package_Gtk.Option_Menu::
* Package_Gtk.Packer::
* Package_Gtk.Paned::
* Package_Gtk.Plug::
* Package_Gtk.Radio_Button::
* Package_Gtk.Scrolled_Window::
* Package_Gtk.Selection::
* Package_Gtk.Signal::
* Package_Gtk.Socket::
* Package_Gtk.Spin_Button::
* Package_Gtk.Status_Bar::
* Package_Gtk.Table::
* Package_Gtk.Text::
* Package_Gtk.Toggle_Button::
* Package_Gtk.Toolbar::
* Package_Gtk.Tooltips::
* Package_Gtk.Tree::
* Package_Gtk.Type_Conversion::
* Package_Gtk.Type_Conversion_Hooks::
* Package_Gtk.Vbutton_Box::
* Package_Gtk.Widget::
* Package_Gtk.Window::
* Package_Gtkada::
* Package_Gtkada.Canvas::
* Package_Gtkada.Dialogs::
* Package_Gtkada.File_Selection::
* Package_Gtkada.Handlers::
* Package_Gtkada.Intl::
* Package_Gtkada.Pixmaps::
* Package_Gtkada.Types::
* Package_Interactive_Canvas::
* Index::


File: gtkada_rm.info,  Node: Package_Glib,  Next: Package_Glib.GSlist,  Prev: Package_Glade_XML,  Up: Top

Package Glib
************

This package provides definitions for the basic types used in Glib,
Gdk and Gtk.

* Menu:

* Glib Types::
* Glib Subprograms::


File: gtkada_rm.info,  Node: Glib Types,  Next: Glib Subprograms,  Up: Package_Glib

Types
=====

type Boolean_Array is array (Natural range <>) of Boolean;

type C_Proxy is access C_Dummy;

General proxy for C structures.   This type is used instead of
System.Address so that the variables are  automatically initialized to
'null'.   The value pointed to is irrelevant, and in fact should not be
accessed.   It has thus been made limited private with no subprogram to
access it.   C_Proxy is a public type so that one can compare directly
the value  of the variables with 'null'.
type GQuark is new Guint32;

Represents a string internally in GtkAda. Once you know the  equivalent
for a string, you can always use it instead of the string,  which
provides a faster access for all the functions that use htables  in
GtkAda.   There is a global htable that contains all the quarks defined
in  your application and GtkAda itself.
type Gboolean is new Gint;

type Gboolean_Array is array (Natural range <>) of Gboolean;

type Gchar is new C.char;

type Gdouble is new C.double;

type Gdouble_Array is array (Natural range <>) of Gdouble;

type Gfloat is new C.C_float;

type Gfloat_Array is array (Natural range <>) of Gfloat;

type Gint is new C.int;

subtype Gint16 is Gint range -(2 ** 15) .. (2 ** 15 - 1);

subtype Gint32 is Gint range -(2 ** 31) .. (2 ** 31 - 1);

subtype Gint8 is Gint range -(2 ** 7) .. (2 ** 7 - 1);

type Gint_Array is array (Natural range <>) of Gint;

type Glong is new C.long;

type Glong_Array is array (Natural range <>) of Glong;

type Gshort is new C.short;

type Gshort_Array is array (Natural range <>) of Gshort;

type Guchar is new C.unsigned_char;

type Guchar_Array is array (Natural range <>) of Guchar;

type Guchar_Array_Access is access Guchar_Array;

type Guint is new C.unsigned;

subtype Guint16 is Guint range Guint'First .. (2 ** 16 - 1);

subtype Guint32 is Guint range Guint'First .. (2 ** 32 - 1);

type Guint32_Array is array (Natural range <>) of Guint32;

subtype Guint8 is Guint range Guint'First .. (2 ** 8 - 1);

type Guint_Array is array (Natural range <>) of Guint;

type Gulong is new C.unsigned_long;

type Gulong_Array is array (Natural range <>) of Gulong;

type Gushort is new C.unsigned_short;

type Gushort_Array is array (Natural range <>) of Gushort;

type Long_Array is array (Natural range <>) of C.long;

type Short_Array is array (Natural range <>) of C.short;

type String_Ptr is access all String;


File: gtkada_rm.info,  Node: Glib Subprograms,  Prev: Glib Types,  Up: Package_Glib

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

Conversion services
-------------------

function To_Boolean_Array
     (A                  : in     Gboolean_Array)
        return Boolean_Array;

Convert a C-style boolean array into an Ada-style array.
function To_Boolean
     (Value              : in     Gboolean)
        return Boolean;

Convert a C boolean into an Ada boolean.
function To_Boolean
     (Value              : in     Gint)
        return Boolean;

Convert a C int into an Ada boolean.
function To_Boolean
     (Value              : in     Guint)
        return Boolean;

Convert a C uint into an Ada boolean.
function To_Gboolean
     (Bool               : in     Boolean)
        return Gboolean;

Convert an Ada boolean into a C boolean.
function To_Gint
     (Bool               : in     Boolean)
        return Gint;

Convert an Ada boolean into a C int.
Quarks
------

function Quark_From_String
     (Id                 : in     String)
        return GQuark;

Return, or create the quark associated with the string.
Note that if the quark does not already exist, an entry is created for
it in the global htable for quarks.
function Quark_Try_String
     (Id                 : in     String)
        return GQuark;

Return the quark associated with the string, if it exists.
If it does not exist, return Unknown_Quark.

File: gtkada_rm.info,  Node: Package_Glib.GSlist,  Next: Package_Glib.Glist,  Prev: Package_Glib,  Up: Top

Package Glib.GSlist
*******************

This packages provides the implementation of a generic single-linked
list.   One instantiation is found in Gtk.Widget.Widget_Slist for a
list of  widgets.

   See the documentation of Glib.Glist for more information, it provides
the same API as this package.   Single linked lists are traversed the
same way as double-linked lists,  even though most subprograms are less
efficient than their  double-linked counterparts.

* Menu:


File: gtkada_rm.info,  Node: Package_Glib.Glist,  Next: Package_Glib.Module,  Prev: Package_Glib.GSlist,  Up: Top

Package Glib.Glist
******************

This package implements a generic double-linked list.   Such lists are
used throughout GtkAda to contain lists of widgets  (for the children
of containers, or for the list of selected widgets  in a Gtk_Clist for
instance), list of strings (for Gtk_Combo_Box),...

   They provide a common interface to traverse these lists.

   One useful note: you should only Free the lists that you have
allocated  yourself, and not the lists that are returned by the
subprograms in  GtkAda and should be left under GtkAda's control.

   See the example below for an example on how to traverse a list.

   Instantiating the package Generic_List requires two functions to
convert  back and forth between your data type and a System.Address
which is the  type stored at the C level.   Note that the lists used in
GtkAda already have associated packages, like  Gtk.Enums.Gint_List,
Gtk.Enums.String_List or Gtk.Widget.Widget_List.

* Menu:

* Glib.Glist Types::
* Glib.Glist Subprograms::
* Glib.Glist Example::


File: gtkada_rm.info,  Node: Glib.Glist Types,  Next: Glib.Glist Subprograms,  Up: Package_Glib.Glist

Types
=====

type Glist is private;

This type is both a list and an item in the list.   Each item points to
its successor.

File: gtkada_rm.info,  Node: Glib.Glist Subprograms,  Next: Glib.Glist Example,  Prev: Glib.Glist Types,  Up: Package_Glib.Glist

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

procedure Alloc
     (List               : out    Glist);

Allocate a new item in the list.
This item isn't associated with any data.   You probably don't have to
use this subprogram, since Append,  Insert, Prepend, etc. already
handle the allocation for you and  give a new value to the item.
procedure Append
     (List               : in out Glist;
        Data               : in     Gpointer);

Add a new item at the end of the list, and stores the new list
directly back in List.   The complexity of this operation is O(n)
function Concat
     (List1              : in     Glist;
        List2              : in     Glist)
        return Glist;

Concatenate two lists, and return the result.
List2 is added at the end of List1.   The complexity is O(n1) (depends
on the size of List1).
procedure Insert
     (List               : in out Glist;
        Data               : in     Gpointer;
        Position           : in     Gint);

Insert an item in the middle of a list.
If Position is 0, the item is added at the beginning of the list, if
it is negative the item is added at the end.   The complexity is
O(Position).
function Find
     (List               : in     Glist;
        Data               : in     Gpointer)
        return Glist;

Find a value in the list, and return the first item that contains it.
Note that this function will not work if the function Convert does  not
return the same value for two identical values.
function First
     (List               : in     Glist)
        return Glist;

Return the first item in the list.
Note that if List is in fact an item of a larger list, the return
value is the first item in the larger list itself.
procedure Free
     (List               : in out Glist);

Free the list (but does not free the data in each of its elements).
This only frees the memory associated with the list itself.   You
should only use this function on the lists that  you have created
yourself, not on the list that are returned by some  functions in
GtkAda (like Gtk.Clist.Get_Selection). These functions  return directly
the list managed by the underlying C widget, and you  should never free
the result yourself.

   Note also that the memory might not be actually freed. For efficiency
reasons, GtkAda will keep the memory allocated and try to reuse it as
much as possible.
function Get_Data
     (List               : in     Glist)
        return Gpointer;

Return the value pointed to by List.
The System.Address container in the C list is converted to a Gpointer
through a call to Convert.
function Get_Data_Address
     (List               : in     Glist)
        return System.Address;

Return directly the System.Address contained in the C list.
This is used mainly internally in GtkAda to implement String lists,
and you should not have to use this subprogram yourself.
function Index
     (List               : in     Glist;
        Data               : in     Gpointer)
        return Gint;

Return the index of the first element in LIST that contains Data.
Note that this function is irrelevant if Convert does not return the
same value for two identical data.
function Last
     (List               : in     Glist)
        return Glist;

Return the last element in the list.
function Length
     (List               : in     Glist)
        return Guint;

Return the number of elements in the list.
The last item's index is Length - 1.
procedure List_Reverse
     (List               : in out Glist);

Reverse the order of the list (the last item becomes the first, etc.)
function Next
     (List               : in     Glist)
        return Glist;

Returns the Item following LIST in the global list that contains
both.   If there is no such item, return Null_List. This is how you
stop iterating over a list.
function Nth
     (List               : in     Glist;
        N                  : in     Guint)
        return Glist;

Give the nth item following LIST in the global list that
contains both.   If there is no such item, return Null_List.
function Nth_Data
     (List               : in     Glist;
        N                  : in     Guint)
        return Gpointer;

Return the Data contained in the N-th item of List.
The result is undefined if there is no such item in the list.   The
actual result in that case is the result of      Convert
(System.Null_Address);  which might not mean anything.
function Position
     (List               : in     Glist;
        Link               : in     Glist)
        return Gint;

Return the position of Link in the List.
If Link is not contained in the list, -1 is returned.
procedure Prepend
     (List               : in out Glist;
        Data               : in     Gpointer);

Add an item at the beginning of the list.
This operation always succeed.
function Prev
     (List               : in     Glist)
        return Glist;

Return the item before List in the global list that contains both.
Return Null_List if there is no such item.
procedure Remove
     (List               : in out Glist;
        Data               : in     Gpointer);

Remove the first item in List that contains Data.
Note that this operation can succeed only if Convert always return  the
same address for a given value.
procedure Remove_Link
     (List               : in out Glist;
        Link               : in     Glist);

Remove Link from the list to which it belongs.
If that list is not List, no error is returned, but Link is removed
anyway.
function Is_Created
     (List               : in     Glist)
        return Boolean;

Return True if there is a C widget associated with List.

File: gtkada_rm.info,  Node: Glib.Glist Example,  Prev: Glib.Glist Subprograms,  Up: Package_Glib.Glist

Example
=======


      with Glib, Glib.Glist, Gtk.Enums, Ada.Text_IO;
      use  Glib, Ada.Text_IO;
     
      procedure Glist_Traverse is
         use Gtk.Enums.Gint_List;
         List : Gtk.Enums.Gint_List.Glist;
         Temp : Gtk.Enums.Gint_List.Glist;
      begin
     
         --  First step: create a new list.
     
         Prepend (List, 2);                       -- add at the beginning of the list
         Append (List, 3);                        -- add at the end of the list
         Insert (List, Data => 1, Position => 1); -- in the middle of the list
     
         --  Traverse the list (first way)
     
         Temp := First (List);
         while Temp /= Null_List loop
            Put_Line (Gint'Image (Get_Data (Temp)));
            Temp := Next (Temp);
         end loop;
     
         --  Traverse the list (second way)
     
         for I in 1 .. Length (List) loop
            Put_Line (Gint'Image (Nth_Data (List, I - 1)));
         end loop;
     
      end Glist_Traverse;


File: gtkada_rm.info,  Node: Package_Glib.Module,  Next: Package_Glib.XML,  Prev: Package_Glib.Glist,  Up: Top

Package Glib.Module
*******************

This package provides wrapper code for dynamic module loading

* Menu:

* Glib.Module Types::
* Glib.Module Subprograms::


File: gtkada_rm.info,  Node: Glib.Module Types,  Next: Glib.Module Subprograms,  Up: Package_Glib.Module

Types
=====

type G_Module is new C_Proxy;

type Module_Flags is mod 2 ** 32;

type Pointer is private;

This is typically a pointer to procedure/function.

File: gtkada_rm.info,  Node: Glib.Module Subprograms,  Prev: Glib.Module Types,  Up: Package_Glib.Module

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

function Module_Supported      return Boolean;

Return True if dynamic module loading is supported
function Module_Open
     (File_Name          :        String;
        Flags              :        Module_Flags
                            := Module_Bind_Lazy)
        return G_Module;

Open a module `file_name' and return handle, which is null on error.
function Module_Close
     (Module             :        G_Module)
        return Boolean;

Close a previously opened module, return True on success.
procedure Module_Make_Resident
     (Module             :        G_Module);

Make a module resident so Module_Close on it will be ignored
function Module_Error          return String;

Query the last module error as a string
procedure Generic_Module_Symbol
     (Module             :        G_Module;
        Symbol_Name        :        String;
        Symbol             : out    Pointer;
        Success            : out    Boolean);

Retrieve a symbol pointer from `module'.
Success is set to True on success.
function Module_Name
     (Module             :        G_Module)
        return String;

Retrieve the file name from an existing module
function Module_Build_Path
     (Directory          :        String;
        Module_Name        :        String)
        return String;

Build the actual file name containing a module.
`directory' is the directory where the module file is supposed to be, or
the null string in which case it should either be in the current
directory or, on some operating systems, in some standard place, for
instance on the PATH. Hence, to be absolutely sure to get the correct
module, always pass in a directory. The file name consists of the
directory, if supplied, and `module_name' suitably decorated accoring to
the operating system's conventions (for instance lib*.so or *.dll).

   No checks are made that the file exists, or is of correct type.

File: gtkada_rm.info,  Node: Package_Glib.XML,  Next: Package_Gtk,  Prev: Package_Glib.Module,  Up: Top

Package Glib.XML
****************

This package provides a simple minded XML parser to be used with  Gate.

* Menu:

* Glib.XML Types::
* Glib.XML Subprograms::


File: gtkada_rm.info,  Node: Glib.XML Types,  Next: Glib.XML Subprograms,  Up: Package_Glib.XML

Types
=====

type Free_Specific_Data is access procedure
     (Data : in out XML_Specific_Data);

type Node is record
     Tag   : String_Ptr;
           -- The name of this node
     
         Attributes   : String_Ptr;
           -- The attributes of this node
     
         Value : String_Ptr;
           -- The value, or null is not relevant
     
         Parent : Node_Ptr;
           -- The parent of this Node.
     
         Child : Node_Ptr;
           -- The first Child of this Node. The next child is Child.Next
     
         Next  : Node_Ptr;
           -- Next "brother" node.
     
         Specific_Data : XML_Specific_Data;
           -- Use to store data specific to each implementation (e.g a boolean
           -- indicating whether this node has been accessed)
         end record;

A node of the XML tree.   Each time a tag is found in the XML file, a
new node is created, that  points to its parent, its children and its
siblings (nodes at the same  level in the tree and with the same
parent).
type Node_Ptr is access all Node;

Pointer to a node of the XML tree.
type XML_Specific_Data is private;

The type of the extra data that can be attached to each node of the
XML tree. See for instance the package Glib.Glade.

File: gtkada_rm.info,  Node: Glib.XML Subprograms,  Prev: Glib.XML Types,  Up: Package_Glib.XML

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

function Parse
     (File               :        String)
        return Node_Ptr;

Parse File and return the first node representing the XML file.
procedure Print
     (N                  :        Node_Ptr;
        Indent             :        Natural := 0;
        File_Name          :        String := "");

Write the tree starting with N into a file File_Name. The generated
file is valid XML, and can be parsed with the Parse function.   If
File_Name is the empty string, then the tree is printed on the
standard output
function Find_Tag
     (N                  :        Node_Ptr;
        Tag                :        String)
        return Node_Ptr;

Find a tag Tag in N and its brothers.
function Get_Field
     (N                  :        Node_Ptr;
        Field              :        String)
        return String_Ptr;

Return the value of the field 'Field' if present in the children of N.
Return null otherwise.
procedure Add_Child
     (N                  :        Node_Ptr;
        Child              :        Node_Ptr);

Add a new child to a node.
function Deep_Copy
     (N                  :        Node_Ptr)
        return Node_Ptr;

Return a deep copy of the tree starting with N. N can then be freed
without affecting the copy.
procedure Free
     (N                  : in out Node_Ptr;
        Free_Data          :        Free_Specific_Data := null);

Free the memory allocated for a node and its children.
It also disconnects N from its parent.   If Free_Data is not null, it
is used to free the memory occupied by  the Specific_Data for each node.
function Get_Attribute
     (N                  : in     Node_Ptr;
        Attribute_Name     : in     String)
        return String_Ptr;

Return the value of the attribute 'Attribute_Name' if present.
Return null otherwise.

File: gtkada_rm.info,  Node: Package_Gtkada,  Next: Package_Gtkada.Canvas,  Prev: Package_Gtk.Window,  Up: Top

Package Gtkada
**************

This is the parent package for the GtkAda specific units.

* Menu:


File: gtkada_rm.info,  Node: Package_Gtkada.Canvas,  Next: Package_Gtkada.Dialogs,  Prev: Package_Gtkada,  Up: Top

Package Gtkada.Canvas
*********************

This package provides an interactive canvas, on which the user can put
items, move them with the mouse, etc. The items can be connected
together,  and the connections remain active while the items are moved.

   It also supports scrolling if put in a Gtk_Scrolled_Window.

   All items put in this canvas must inherit from the type
Canvas_Item_Record.   However, it is your responsability, as a
programmer, to provide drawing  routines. In fact, all these items
should draw in a pixmap, which is then  copied automatically to the
screen whenever the canvas needs to redraw  itself.

   The items can also react to mouse events: mouse clicks are
transmitted to  the item if the mouse did not move more than a given
amount of pixels.   To decide what their reaction should be, you should
override the  On_Button_Click subprogram.

   This canvas is not intended for cases where you want to put hundreds
of  items on the screen. For instance, it does not provide any smart
double-buffering, and thus you would get some flicker if there are too
many items.

* Menu:

* Gtkada.Canvas Signals::
* Gtkada.Canvas Types::
* Gtkada.Canvas Subprograms::


File: gtkada_rm.info,  Node: Gtkada.Canvas Signals,  Next: Gtkada.Canvas Types,  Up: Package_Gtkada.Canvas

Signals
=======

   * "background_click"

     procedure Handler (Canvas : access Interactive_Canvas_Record'Class;
     Event  : Gdk.Event.Gdk_Event);
     Called every time the user clicks in the background (ie not on an
     item, or On_Button_Click would be called).  This is called both on
     Button_Release and Button_Press events.  The coordinates (X, Y) in
     the Event are relative to the top-left corner of Canvas.

   * "item_selected"

     procedure Handler (Canvas : access Interactive_Canvas_Record'Class;
     Item   : Canvas_Item);
     Called when the user has clicked on an item to select it, ie
     before any drag even has occured. This is a good time to add other
     items to the selection if you need.

   * "zoomed"

     procedure Handler (Canvas : access
     Interactive_Canvas_Record'Class);
     Emitted when the canvas has been zoomed in or out. You must resize
     the items as needed, and possibily refresh their internal
     double-pixmap.  However, you do not need to redraw them on the
     screen, this will be handled by separate calls to Draw.



File: gtkada_rm.info,  Node: Gtkada.Canvas Types,  Next: Gtkada.Canvas Subprograms,  Prev: Gtkada.Canvas Signals,  Up: Package_Gtkada.Canvas

Types
=====

type Arrow_Type is
     (No_Arrow,
             -- the link does not have an arrow
     
          Start_Arrow,
             -- the link has an arrow at its beginning
     
          End_Arrow,
             -- the link has an arrow at the end
     
          Both_Arrow
             -- the link has an arrow on both sides
          );

Indicate whether the links have an arrow or not.
type Item_Processor is access function
     (Canvas : access Interactive_Canvas_Record'Class;

type Link_Processor is access function
     (Canvas : access Interactive_Canvas_Record'Class;


File: gtkada_rm.info,  Node: Gtkada.Canvas Subprograms,  Prev: Gtkada.Canvas Types,  Up: Package_Gtkada.Canvas

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

Creating a canvas
-----------------

procedure Gtk_New
     (Canvas             : out    Interactive_Canvas);

Create a new empty Canvas.
The canvas includes a grid in its background.
procedure Configure
     (Canvas             : access Interactive_Canvas_Record;
        Grid_Size          :        Glib.Guint
                            := Default_Grid_Size;
        Annotation_Font    :        String
                            := Default_Annotation_Font;
        Annotation_Height  :        Glib.Gint
                            := Default_Annotation_Height;
        Arc_Link_Offset    :        Glib.Gint
                            := Default_Arc_Link_Offset;
        Arrow_Angle        :        Glib.Gint
                            := Default_Arrow_Angle;
        Arrow_Length       :        Glib.Gint
                            := Default_Arrow_Length;
        Motion_Threshold   :        Glib.Gint
                            := Default_Motion_Threshold);

Change the parameters for the canvas.
A Grid_Size of 0 means than no grid should be drawn in the background of
canvas. Note that in that case you can never activate Align_On_Grid.
procedure Align_On_Grid
     (Canvas             : access Interactive_Canvas_Record;
        Align              :        Boolean := True);

Choose whether the items should be aligned on the grid when moved.
Existing items are not moved even if you set this parameter to True,
this will only take effect the next time the items are moved.
function Get_Align_On_Grid
     (Canvas             : access Interactive_Canvas_Record)
        return Boolean;

Return True if items are currently aligned on grid.
procedure Move_To
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class;
        X, Y               :        Glib.Gint := Glib.Gint'First);

Move the item in the canvas.
Item is assumed to be already in the canvas.   If at least one of X or
Y has the default value, then the item  is placed automatically in a
free area of the canvas.   Its new position depends on whether it has
links to other existing  items (in which case it is placed to the right
of it), or not (in which  case it is placed at the bottom of the
leftmost column).
procedure Put
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class;
        X, Y               :        Glib.Gint := Glib.Gint'First);

Add a new item to the canvas.
The item is added at a specific location.   If at least one of X or Y
has the default value, then the item  is placed automatically in a free
area of the canvas.   Its new position depends on whether it has links
to other existing  items (in which case it is placed to the right of
it), or not (in which  case it is placed at the bottom of the leftmost
column).   Note also that the current size of the item is used to
compute the new  location, so it should depend on the current zoom.
procedure Remove
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Remove an item and all the links to and from it from the canvas.
The item itself is not freed, but the links are.   Nothing is done if
the item is not part of the canvas.
procedure Item_Updated
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

This should be called when Item has changed the contents of its
pixmap, and thus the Canvas should be updated.
procedure Refresh_Canvas
     (Canvas             : access Interactive_Canvas_Record);

Redraw the whole canvas (both in the double buffer and on the screen).
procedure For_Each_Item
     (Canvas             : access Interactive_Canvas_Record;
        Execute            :        Item_Processor);

Execute an action on each of the items contained in the canvas.
If Execute returns False, we stop traversing the list of children.   It
is safe to remove the items in Item_Processor.
function Has_Link
     (Canvas             : access Interactive_Canvas_Record;
        From, To           : access Canvas_Item_Record'Class;
        Name               :        String := "")
        return Boolean;

Test whether there is a link from From to To, with the same name.
If Name is the empty string "", then no check is done on the name,  and
True if returned if there is any link between the two items.
procedure Raise_Item
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Raise the item so that it is displayed on top of all the others
The canvas is refreshed as needed to reflect the change.   Nothing
happens if Item is not part of the canvas.
procedure Lower_Item
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Lower the item so that it is displayed below all the others.
The canvas is refreshed as needed to reflect the change.   Nothing
happens if Item is not part of the canvas.
function Is_On_Top
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class)
        return Boolean;

Return True if Item is displayed on top of all the others in the canvas.
procedure Show_Item
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Scroll the canvas so that Item is visible.
procedure Zoom
     (Canvas             : access Interactive_Canvas_Record;
        Percent            :        Glib.Guint := 100;
        Steps              :        Glib.Guint := 1);

Zoom in or out in the canvas. All items are resized, and their contents
is then random.   You must either redraw them systematically
afterwards, or connect to the  "zoomed" signal which is emitted
automatically by this subprogram.

   Steps is the number of successive zooms that will be done to provide
smooth scrolling.

   Note that one possible use for this function is to refresh the canvas
and emit the "zoomed" signal, which might redraw all the items. This
can  be accomplished by keeping the default 100 value for Percent.
function Get_Zoom
     (Canvas             : access Interactive_Canvas_Record)
        return Glib.Guint;

Return the current zoom level
function To_Canvas_Coordinates
     (Canvas             : access Interactive_Canvas_Record'Class;
        X                  :        Glib.Gint)
        return Glib.Gint;

Scale the scalar X depending by the zoom level (map from world
coordinates to canvas coordinates)
function To_World_Coordinates
     (Canvas             : access Interactive_Canvas_Record'Class;
        X                  :        Glib.Gint)
        return Glib.Gint;

Scale the scalar X depending by the zoom level (map from canvas
coordinates to world coordinates)
Links
-----

procedure Configure
     (Link               : access Canvas_Link_Record;
        Src                : access Canvas_Item_Record'Class;
        Dest               : access Canvas_Item_Record'Class;
        Arrow              : in     Arrow_Type := End_Arrow;
        Descr              : in     String := "");

Configure a link.
The link is an oriented bound between two items on the canvas.   If
Descr is not the empty string, it will be displayed in the middle  of
the link, and should indicate what the link means.   Arrow indicates
whether some arrows should be printed as well.
function Get_Src
     (Link               : access Canvas_Link_Record)
        return Canvas_Item;

Return the source item for the link
function Get_Dest
     (Link               : access Canvas_Link_Record)
        return Canvas_Item;

Return the destination item for the link
function Get_Descr
     (Link               : access Canvas_Link_Record)
        return String;

Return the description for the link, or "" if there is none
procedure Set_Src_Pos
     (Link               : access Canvas_Link_Record;
        X_Pos, Y_Pos       :        Glib.Gfloat := 0.5);

Set the position of the link's attachment in its source item.
X_Pos and Y_Pos should be given between 0 and 100 (from left to right
or top to bottom).
procedure Set_Dest_Pos
     (Link               : access Canvas_Link_Record;
        X_Pos, Y_Pos       :        Glib.Gfloat := 0.5);

Same as Set_Src_Pos for the destination item
procedure Add_Link
     (Canvas             : access Interactive_Canvas_Record;
        Link               : access Canvas_Link_Record'Class);

Add a link to the canvas. The link must have been created first.
procedure Add_Link
     (Canvas             : access Interactive_Canvas_Record;
        Src                : access Canvas_Item_Record'Class;
        Dest               : access Canvas_Item_Record'Class;
        Arrow              : in     Arrow_Type := End_Arrow;
        Descr              : in     String := "");

Create and add a link between two items.
Simpler procedure to add a standard link.   This takes care of memory
allocation, as well as adding the link to  the canvas.
procedure Remove_Link
     (Canvas             : access Interactive_Canvas_Record;
        Link               : access Canvas_Link_Record'Class);

Remove a link from the canvas.
It also destroys the link itself, and free the memory allocated to it.
Nothing is done if Link does not belong to canvas.
procedure For_Each_Link
     (Canvas             : access Interactive_Canvas_Record;
        Execute            :        Link_Processor);

Execute an action on each of the links contained in the canvas.
If Execute returns False, we stop traversing the list of links.   It is
safe to remove the link from the list in Link_Processor.
procedure Destroy
     (Link               : access Canvas_Link_Record);

Method called every time a link is destroyed. You should override this
if you define your own link types.   Note that the link might already
have been removed from the canvas  when this subprogram is called.
This shouldn't free the link itself, only its fields.
Selection
---------

procedure Clear_Selection
     (Canvas             : access Interactive_Canvas_Record);

Clear the list of currently selected items.
procedure Add_To_Selection
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Add Item to the selection.  This is only meaningful during a drag
operation (ie during a button press and the matching button  release).
Item will be moved at the same time that the selection is  moved.
Item is not added again if it is already in the selection.   This
function can be called from the Button_Click subprogram to force
moving items.
procedure Remove_From_Selection
     (Canvas             : access Interactive_Canvas_Record;
        Item               : access Canvas_Item_Record'Class);

Remove Item from the selection.
Items manipulation
------------------

procedure Set_Screen_Size
     (Item               : access Canvas_Item_Record;
        Width              :        Glib.Gint;
        Height             :        Glib.Gint);

Set the size that the items occupies on the screen. You must call this
subprogram every time the zoom level changes, since Width and Height
must reflect the current size of the item in the current zoom level,
not an absolute size that is automatically scaled.
procedure Draw
     (Item               : access Canvas_Item_Record;
        Canvas             : access Interactive_Canvas_Record'Class;
        Dest               :        Gdk.Pixmap.Gdk_Pixmap;
        Xdest, Ydest       :        Glib.Gint);

This subprogram, that must be overridden, should draw the item on
the pixmap Dest, at the specific location (At_X, At_Y).
procedure Destroy
     (Item               : access Canvas_Item_Record);

Free the memory occupied by the item (not the item itself). You should
override this function if you define your own widget type.
procedure On_Button_Click
     (Item               : access Canvas_Item_Record;
        Event              :        Gdk.Event.Gdk_Event_Button);

Function called whenever the item was clicked on.
Note that this function is not called when the item is moved, and thus
is only called when the click was short.   If it returns True, the
canvas it redrawn afterwards (in case the item  has changed for
instance).   This procedure is never called for events that are used to
move the  item in the canvas.   The coordinates (X, Y) in the Event are
relative to the top-left corner  of Item.
function Get_Coord
     (Item               : access Canvas_Item_Record)
        return Gdk.Rectangle.Gdk_Rectangle;

Return the coordinates and size of the item.
procedure Set_Visibility
     (Item               : access Canvas_Item_Record;
        Visible            :        Boolean);

Set the visibility status of the item.
The canvas is not refreshed (this is your responsibility to do it after
you have finished doing all the modifications).
function Is_Visible
     (Item               : access Canvas_Item_Record)
        return Boolean;

Return True if the item is currently visible.
Buffered items
--------------

procedure Draw
     (Item               : access Buffered_Item_Record;
        Canvas             : access Interactive_Canvas_Record'Class;
        Dest               :        Gdk.Pixmap.Gdk_Pixmap;
        Xdest, Ydest       :        Glib.Gint);

Draw the item's double-buffer onto Dest.
procedure Destroy
     (Item               : access Buffered_Item_Record);

Free the double-buffer allocated for the item
procedure Set_Screen_Size_And_Pixmap
     (Item               : access Buffered_Item_Record;
        Win                :        Gdk.Window.Gdk_Window;
        Width, Height      :        Glib.Gint);

Sets the size used on the screen by item, and reallocate the pixmap
if needed
function Pixmap
     (Item               : access Buffered_Item_Record)
        return Gdk.Pixmap.Gdk_Pixmap;

Return the double-buffer that must be updated every time the canvas
is scrolled.

File: gtkada_rm.info,  Node: Package_Gtkada.Dialogs,  Next: Package_Gtkada.File_Selection,  Prev: Package_Gtkada.Canvas,  Up: Top

Package Gtkada.Dialogs
**********************

This package provides a ready to use high level dialog capability.

* Menu:

* Gtkada.Dialogs Types::
* Gtkada.Dialogs Subprograms::


File: gtkada_rm.info,  Node: Gtkada.Dialogs Types,  Next: Gtkada.Dialogs Subprograms,  Up: Package_Gtkada.Dialogs

Types
=====

type Button_Range is range 0 .. 8;

The range of valid buttons.
type Message_Dialog_Buttons is mod 2 ** 32;

Define the set of values a button in a message dialog box can have.
type Message_Dialog_Type is
     (Warning,
             -- Message box with a yellow exclamation point.
     
          Error,
             -- Message box with a red stop sign.
     
          Information,
             -- Message box with a blue "i".
     
          Confirmation,
             -- Message box with a blue question mark.
     
          Custom
             -- Message box with no pixmap. The caption of the box should be set by
             -- the user.
          );

Define the values describing the type of message box.   Used by the
Message_Dialog function.

File: gtkada_rm.info,  Node: Gtkada.Dialogs Subprograms,  Prev: Gtkada.Dialogs Types,  Up: Package_Gtkada.Dialogs

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

function Message_Dialog
     (Msg                :        String;
        Dialog_Type        :        Message_Dialog_Type
                            := Information;
        Buttons            :        Message_Dialog_Buttons
                            := Button_OK or Button_Help;
        Default_Button     :        Message_Dialog_Buttons
                            := Button_OK;
        Help_Msg           :        String := "";
        Title              :        String := "";
        Justification      :        Gtk_Justification
                            := Justify_Center)
        return Message_Dialog_Buttons;

Display a message dialog box centered on the mouse.
This will create a dialog box containing the specified message.
Dialog_Type indicates the purpose of the dialog.   Buttons indicates
which buttons should appear in the dialog.   Help_Msg is the message
displayed in a separate dialog box when the help  button is pressed
while the dialog is displayed.   If Help_Msg is null, a dialog
containing the message  "No help available" will be displayed. In both
cases, the dialog  displayed will only have a OK button.   If Title is
null, a default title will be chosen depending on the value  of
Dialog_Type.

   This function will return only after the user pressed one of the
buttons  or deleted the dialog, by running an additional level of main
loop.   One of the following values will be returned:
   * Button_None

   * Button_Abort

   * Button_Yes

   * Button_Ok

   * Button_Retry

   * Button_No

   * Button_Cancel

   * Button_Ignore

   * Button_All


File: gtkada_rm.info,  Node: Package_Gtkada.File_Selection,  Next: Package_Gtkada.Handlers,  Prev: Package_Gtkada.Dialogs,  Up: Top

Package Gtkada.File`_'Selection
*******************************

This package provides a high level support for creating file selection
dialogs by handling the signals internally.

* Menu:

* Gtkada.File_Selection Subprograms::


File: gtkada_rm.info,  Node: Gtkada.File_Selection Subprograms,  Up: Package_Gtkada.File_Selection

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

function File_Selection_Dialog
     (Title              :        String := "Select File";
        Default_Dir        :        String := "";
        Dir_Only           :        Boolean := False;
        Must_Exist         :        Boolean := False)
        return String;

Open a file selection dialog and make it modal.
Return when either the Cancel button is clicked or when a file is
selected.   Default_Dir is the directory to display in dialog
initially. Note that  it must end with a directory separator ('/' or
'\', depending on your  system). You can use
GNAT.Os_Lib.Directory_Separator to get the correct  value for your
system.   If Must_Exist is True, then the file (or directory if
Dir_Only is True)  must exist.   If Dir_Only is True, then the dialog
is modified so that the user can  only choose a directory name, but not
a file name.   The value returned is the name of the file selected, or
"" if none.

File: gtkada_rm.info,  Node: Package_Gtkada.Handlers,  Next: Package_Gtkada.Intl,  Prev: Package_Gtkada.File_Selection,  Up: Top

Package Gtkada.Handlers
***********************

This package provides the most commonly used instantiations of
Gtk.Handlers

   Gate takes advantage of these pre-instantiated packages.

* Menu:


File: gtkada_rm.info,  Node: Package_Gtkada.Intl,  Next: Package_Gtkada.Pixmaps,  Prev: Package_Gtkada.Handlers,  Up: Top

Package Gtkada.Intl
*******************

This package provides support for string internationalization using the
libintl library.

   To change the current locale setting, use on the environment
variables  "LANG" or "LC_MESSAGES". For example, to switch to the
french locale using  bash:

   $ export LANG=fr

   Depending on the specific implementation of gettext, the following
environment variables may be set to change the default settings of
locale  parameters:

   * LANG Specifies locale name.

   * LC_MESSAGES          Specifies messaging locale, and if present
     overrides          LANG for messages.

   * TEXTDOMAIN          Specifies the text domain name, which is
     identical to          the message object filename without .mo
     suffix.

   * TEXTDOMAINDIR          Specifies the pathname to the message
     database, and  if          present replaces the default (e.g
     /usr/lib/locale on Solaris,          /usr/share/locale on Linux).

    See the gettext documentation of your specific OS for more details.

   The recommended way to use the gettext capability in your
application is  to use Dgettext with your own domain, and define the
following shortcut:

   function "-" (Msg : String) return String;  -  Convenient shortcut
to the Gettext function.

   function "-" (Msg : String) return String is  begin     return
Dgettext ("my_domain", Msg);  end "-";

   Do not forget to call Bind_Text_Domain ("my_domain", "my locale
prefix")  at the beginning of your program. For example, if the prefix
of your  application is /usr, the standard location of the locale would
be /usr/share/locale, e.g:    Bind_Text_Domain ("GtkAda",
"/usr/share/locale");

   Under this locale directory, the functions provided by this package
will look for the directory $LANG/LC_MESSAGES,
/usr/share/locale/fr/LC_MESSAGES in our example; and in this directory,
the file <domain>.mo will be used, e.g
/usr/share/locale/fr/LC_MESSAGES/GtkAda.mo

   The .mo files can be generated using the GNU tool msgfmt that takes a
text file containing for each string the original and the translation.
See msgfmt documentation for more details.   Here is a sample
translation file that can be used as an input for msgfmt:

   # gtkada-fr.po  msgid  "Help"  msgstr "Aide"

   msgid  "Yes"  msgstr "Oui"

   $ msgfmt gtkada-fr.po -o gtkada-fr.gmo  $ cp gtkada-fr.gmo
/usr/share/locale/fr/LC_MESSAGES/GtkAda.mo

   Then, to enable the string translation in your application, use the
"-"  function defined above, e.g:

   Gtk_New (Label, -"Help");  Gtk_New (Label, -("Help ?") & ASCII.LF &
-("Yes"));

* Menu:

* Gtkada.Intl Subprograms::


File: gtkada_rm.info,  Node: Gtkada.Intl Subprograms,  Up: Package_Gtkada.Intl

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

function Gettext
     (Msg                :        String)
        return String;

Look up Msg in the current default message catalog.
Use the current locale as specified by LC_MESSAGES. If not found, return
Msg itself (the default text).
function Dgettext
     (Domain             :        String;
        Msg                :        String)
        return String;

Look up Msg in the Domain message catalog for the current locale.
function "-"
     (Msg                :        String)
        return String;

Shortcut for Dgettext ("GtkAda", Msg)
function Dcgettext
     (Domain             :        String;
        Msg                :        String;
        Category           :        Integer)
        return String;

Look up Msg in the Domain message catalog for the Category locale.
function Default_Text_Domain   return String;

Return the current default message catalog.
procedure Text_Domain
     (Domain             :        String := "");

Set the current default message catalog to Domain.
If Domain is "", reset to the default of "messages".
procedure Bind_Text_Domain
     (Domain             :        String;
        Dirname            :        String);

Specify that the Domain message catalog will be found in Dirname.
This overrides the default system locale data base.

File: gtkada_rm.info,  Node: Package_Gtkada.Pixmaps,  Next: Package_Gtkada.Types,  Prev: Package_Gtkada.Intl,  Up: Top

Package Gtkada.Pixmaps
**********************

This package provides a collection of "standard" pixmaps

* Menu:

* Gtkada.Pixmaps Subprograms::


File: gtkada_rm.info,  Node: Gtkada.Pixmaps Subprograms,  Up: Package_Gtkada.Pixmaps

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

function "+"
     (Str                : in     String)
        return Gtkada.Types.Chars_Ptr;


File: gtkada_rm.info,  Node: Package_Gtkada.Types,  Next: Package_Interactive_Canvas,  Prev: Package_Gtkada.Pixmaps,  Up: Top

Package Gtkada.Types
********************

This package provides GtkAda specific types and their associated
functions.

* Menu:

* Gtkada.Types Subprograms::

