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


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

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

Creating a menu
---------------

procedure Gtk_New
     (Widget             : out    Gtk_Menu);

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

Return the internal value associated with a Gtk_Menu.
procedure Append
     (Menu               : access Gtk_Menu_Record;
        Child              : access Gtk_Menu_Item_Record'Class);

Append a new item to the menu.
The new item is added at the end of the menu.
procedure Insert
     (Menu               : access Gtk_Menu_Record;
        Child              : access Gtk_Menu_Item_Record'Class;
        Position           : in     Gint := 0);

Add a new item to the menu, at a given position.
The first position in the menu is number 0.   If Position is 0, this
procedure is the same as Prepend.
procedure Prepend
     (Menu               : access Gtk_Menu_Record;
        Child              : access Gtk_Menu_Item_Record'Class);

Add a new item at the end of a menu.
procedure Reorder_Child
     (Menu               : access Gtk_Menu_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Position           : in     Gint);

Move an existing menu_item within the menu.
Its new position is given by Position, 0 being the first item in the
menu.   If Child does not exist in the menu, nothing is done.
procedure Set_Tearoff_State
     (Menu               : access Gtk_Menu_Record;
        Torn_Off           : in     Boolean);

Modify the tearoff status of the menu.
If Torn_Off is False, the menu is displayed as a drop down menu which
disappears when the menu is not active. If Torn_Off is True, the menu
persists until it is closed or reattached.   Note that you can give the
user access to this functionality by  inserting a Gtk_Tearoff_Menu_Item
in the menu.
procedure Set_Title
     (Menu               : access Gtk_Menu_Record;
        Title              : in     String);

Set the title of the menu.
Title is displayed when the menu is displayed as a tearoff menu in an
independent window.
procedure Set_Active
     (Menu               : access Gtk_Menu_Record;
        Index              : in     Guint);

Select a specified item in the menu.
You will almost never need this function, it is used internally by
Gtk_Option_Menu.   Note that the item is not considered as being
pressed by the user, and  thus no callback is called as a result.
function Get_Active
     (Menu               : access Gtk_Menu_Record)
        return Gtk.Menu_Item.Gtk_Menu_Item;

Get the active menu item.
In a Gtk_Option_Menu, this is the item that is currently shown in the
button.
Displaying a menu
-----------------

procedure Popup
     (Menu               : access Gtk_Menu_Record;
        Parent_Menu_Shell  : in     Gtk.Menu_Shell.Gtk_Menu_Shell
                            := null;
        Parent_Menu_Item   : in     Gtk.Menu_Item.Gtk_Menu_Item
                            := null;
        Func               : in     Gtk_Menu_Position_Func := null;
        Button             : in     Guint := 1;
        Activate_Time      : in     Guint32 := 0);

Display a menu on the screen.
This is the function to use to create contextual menus.   Most of the
time, the parameters can have a null value.   Parent_Menu_Shell is the
Gtk_Menu_Shell that contains Parent_Menu_Item,  i.e. the widget that
triggered the display of the menu.   Func is a function that returns
the coordinates for the menu. If it is  null, then a default function
that positions the menu at the pointer  location is used.   Button is
the mouse button that was pressed to initiate the event.
Activate_Time is the time at which the event occurred (you can get it
directly from the Gdk_Event structure).

   Note that a variant of this function is given in the generic package
User_Menu_Popup.
procedure Popup
     (Menu               : access Gtk_Menu_Record;
        Data               : access Data_Type;
        Parent_Menu_Shell  : in     Gtk.Menu_Shell.Gtk_Menu_Shell
                            := null;
        Parent_Menu_Item   : in     Gtk.Menu_Item.Gtk_Menu_Item
                            := null;
        Func               : in     Gtk_Menu_Position_Func := null;
        Button             : in     Guint := 1;
        Activate_Time      : in     Guint32 := 0);

Same as the Popup function above.
Note that Data is not duplicated, thus you should take care of the
memory allocation/deallocation yourself.
procedure Popdown
     (Menu               : access Gtk_Menu_Record);

Remove the menu from the screen
procedure Reposition
     (Menu               : access Gtk_Menu_Record);

Reposition a menu according to its position function.
This function is set when Popup is called.
Modifying the accelerators
--------------------------

procedure Set_Accel_Group
     (Menu               : access Gtk_Menu_Record;
        Accel              : in     Accel_Group.Gtk_Accel_Group);

Set the Accel_Group that holds the global accelerators and key bindings
for the menu.
function Get_Accel_Group
     (Menu               : access Gtk_Menu_Record)
        return Accel_Group.Gtk_Accel_Group;

Get the accelerator group used to set the key bindings in the menu.
function Get_Uline_Accel_Group
     (Menu               : access Gtk_Menu_Record)
        return Accel_Group.Gtk_Accel_Group;

Get the accelerator group that is used internally by the menu for
underline accelerators while the menu is popped up.
function Ensure_Uline_Accel_Group
     (Menu               : access Gtk_Menu_Record)
        return Accel_Group.Gtk_Accel_Group;

Make sure there exists a group of accelerators for the underline
characters when the menu is popped up.
Attaching a menu to a widget
----------------------------

procedure Attach_To_Widget
     (Menu               : access Gtk_Menu_Record;
        Attach_Widget      : access Gtk.Widget.Gtk_Widget_Record'Class;
        Detacher           : in     Gtk_Menu_Detach_Func);

Attach a menu to the widget.
When the menu is detached from the widget (for instance when it is
destroyed), the procedure Detached will be called.   You will almost
never need to use this function, unless you specifically  want a call
back when a widget becomes unavailable.   If Attach_Widget is a
menu_item with a single label in it, the name of  the window created
when Menu is teared-off will be the label in the  menu_item.
procedure Detach
     (Menu               : access Gtk_Menu_Record);

Detach the menu from its widget, and call the Detacher set in
Attach_To_Widget.
function Get_Attach_Widget
     (Menu               : access Gtk_Menu_Record)
        return Gtk.Widget.Gtk_Widget;

Return the widget to which the menu was attached.
If the menu was not attached, this function returns null.

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

Example
=======


      --  This example shows how you create contextual menus with the third mouse
      --  button.
     
      with Gtk.Handlers, Gtk.Menu, Gtk.Widget, Gdk.Types, Gdk.Event, Glib;
      with Gtk.Window, Gtk.Menu_Item, Gtk.Enums, Gtk.Main;
      use  Gtk.Handlers, Gtk.Menu, Gtk.Widget, Gdk.Types, Gdk.Event, Glib;
      use  Gtk.Window, Gtk.Menu_Item, Gtk.Enums, Gtk.Main;
     
      procedure Contextual is
     
         package Menu_Cb is new Gtk.Handlers.Return_Callback
           (Widget_Type => Gtk_Menu_Record,  Return_Type => Boolean);
     
         function Popup_Menu_Handler (Menu  : access Gtk_Menu_Record'Class;
                                      Event : Gdk.Event.Gdk_Event)
                                     return Boolean
         is
         begin
            if Gdk.Event.Get_Event_Type (Event) = Button_Press
              and then Gdk.Event.Get_Button (Event) = 3
            then
               Popup (Menu,
                      Button            => Gdk.Event.Get_Button (Event),
                      Activate_Time     => Gdk.Event.Get_Time (Event));
            end if;
            return False;
         end Popup_Menu_Handler;
     
     
         Menu  : Gtk_Menu;
         Win   : Gtk_Window;
         Item  : Gtk_Menu_Item;
      begin
         Gtk.Main.Init;
     
         --  create the menu as usual
         Gtk_New (Menu);
         Gtk_New (Item, "Item1");
         Append (Menu, Item);
         Show (Item);
     
         --  create the widget on which you want a contextual menu
         --  Prepares it to receive button_press events
         Gtk_New (Win, Window_Toplevel);
         Set_Events (Win, Button_Press_Mask);
     
         --  Finally, connect both:
         Menu_Cb.Object_Connect
            (Win, "button_press_event",
             Menu_Cb.To_Marshaller (Popup_Menu_Handler'Access),
             Slot_Object => Menu);
     
         Show_All (Win);
         Gtk.Main.Main;
      end Contextual;


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

Package Gtk.Menu`_'Bar
**********************

Gtk_Menu_Bar is a subclass of Gtk_Menu_Shell which contains one to many
Gtk_Menu_Item. The result is a standard menu bar which can hold many
menu  items. Gtk_Menu_Bar allows for a shadow type to be set for
aesthetic  purposes. The shadow types are defined in the
Set_Shadow_Type function.

* Menu:

* Gtk.Menu_Bar Widget Hierarchy::
* Gtk.Menu_Bar Subprograms::


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

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

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


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

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

procedure Gtk_New
     (Menu_Bar           : out    Gtk_Menu_Bar);

Create a menu bar.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Menu_Bar.
procedure Append
     (Menu_Bar           : access Gtk_Menu_Bar_Record;
        Child              : access Gtk.Menu_Item.Gtk_Menu_Item_Record'Class);

Add a new Gtk_Menu_Item to the end of the Gtk_Menu_Bar.
procedure Insert
     (Menu_Bar           : access Gtk_Menu_Bar_Record;
        Child              : access Gtk.Menu_Item.Gtk_Menu_Item_Record'Class;
        Position           : in     Gint);

Add a new Gtk_Menu_Item to the Gtk_Menu_Bar at a specified position.
The first element of a menu bar is at position 0.
procedure Prepend
     (Menu_Bar           : access Gtk_Menu_Bar_Record;
        Child              : access Gtk.Menu_Item.Gtk_Menu_Item_Record'Class);

Add a new Gtk_Menu_Item to the beginning of the Gtk_Menu_Bar.
procedure Set_Shadow_Type
     (Menu_Bar           : access Gtk_Menu_Bar_Record;
        The_Type           : in     Gtk_Shadow_Type);

Set the shadow type to use on the Gtk_Menu_Bar.

File: gtkada_rm.info,  Node: Package_Gtk.Menu_Item,  Next: Package_Gtk.Menu_Shell,  Prev: Package_Gtk.Menu_Bar,  Up: Top

Package Gtk.Menu_Item
*********************


File: gtkada_rm.info,  Node: Package_Gtk.Menu_Shell,  Next: Package_Gtk.Misc,  Prev: Package_Gtk.Menu_Item,  Up: Top

Package Gtk.Menu`_'Shell
************************

This widget is a base class for all menu widgets. It contains a list of
items that can be navigated, selected and activated by the user.   It
can not be instantiated directly.

   A menu is considered "active" when it is displayed on the screen,
or, in  the case of a menu_bar when one of its menus is active.

   An item is "selected" if it is displayed in a prelight state and its
submenu (if any) displayed.

* Menu:

* Gtk.Menu_Shell Widget Hierarchy::
* Gtk.Menu_Shell Signals::
* Gtk.Menu_Shell Types::
* Gtk.Menu_Shell Subprograms::


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

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

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


File: gtkada_rm.info,  Node: Gtk.Menu_Shell Signals,  Next: Gtk.Menu_Shell Types,  Prev: Gtk.Menu_Shell Widget Hierarchy,  Up: Package_Gtk.Menu_Shell

Signals
=======

   * "activate_current"

     procedure Handler (Menu_Shell : access Gtk_Menu_Shell_Record'Class;
     Force_Hide : Gboolean);
     Activates the current menu item within the Menu_Shell.  if
     Force_Hide is True, hide the menu afterwards.

   * "cancel"

     procedure Handler (Menu_Shell : access
     Gtk_Menu_Shell_Record'Class);
     Cancels the selection within the menu_shell. Causes a
     "selection-done" signal to be emitted.

   * "deactivate"

     procedure Handler (Menu_Shell : access
     Gtk_Menu_Shell_Record'Class);
     Emitted when the menu is deactivated, ie is erased from the screen.

   * "move_current"

     procedure Handler (Menu_Shell : access Gtk_Menu_Shell_Record'Class;
     Direction  : Gtk_Menu_Direction_Type);
     An action signal which selects another menu item (given by
     direction).  In a menu, this is bound by default to the arrow keys
     to move the the selection.

   * "selection-done"

     procedure Handler (Menu_Shell : access
     Gtk_Menu_Shell_Record'Class);
     Emitted when an item has been selected. The menu shell might not be
     activated when the signal is emitted.



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

Types
=====

type Gtk_Menu_Direction_Type is
     (Menu_Dir_Parent,
          Menu_Dir_Child,
          Menu_Dir_Next,
          Menu_Dir_Prev);

Direction where to move the selection. See the signal "selection-done"
below.

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

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

procedure Append
     (Menu_Shell         : access Gtk_Menu_Shell_Record;
        Child              : access Gtk_Menu_Item_Record'Class);

Add a new item at the end of the menu.
procedure Prepend
     (Menu_Shell         : access Gtk_Menu_Shell_Record;
        Child              : access Gtk_Menu_Item_Record'Class);

Add a new item at the beginning of the menu
procedure Insert
     (Menu_Shell         : access Gtk_Menu_Shell_Record;
        Child              : access Gtk_Menu_Item_Record'Class;
        Position           : in     Gint);

Add a new item at a specific position in the menu.
The first item is at position 0. To insert as the last item in the menu,
set Position to -1.
procedure Select_Item
     (Menu_Shell         : access Gtk_Menu_Shell_Record;
        Item               : access Gtk_Menu_Item_Record'Class);

Select a new item in the menu, after deselecting the current item.
procedure Deselect
     (Menu_Shell         : access Gtk_Menu_Shell_Record);

Deselect the currently selected item.
procedure Activate_Item
     (Menu_Shell         : access Gtk_Menu_Shell_Record;
        Item               : access Gtk_Menu_Item_Record'Class;
        Force_Deactivate   :        Boolean);

Activate the item.
If Force_Deactivate is True or the menu_shell sets this property,
Menu_Shell and all its parent menus are deactivated and erased from
the screen.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Menu_Shell.
Signals emission
----------------

procedure Deactivate
     (Menu_Shell         : access Gtk_Menu_Shell_Record);

Emit the "deactivate" signal.
This deselects the selected item, ungrabs the mouse and keyboard, and
erase the Menu_Shell from the screen.

File: gtkada_rm.info,  Node: Package_Gtk.Misc,  Next: Package_Gtk.Notebook,  Prev: Package_Gtk.Menu_Shell,  Up: Top

Package Gtk.Misc
****************

This widget is a base class for all the widgets that require an
alignment and padding.   This widget can not be instantiated directly.

* Menu:

* Gtk.Misc Widget Hierarchy::
* Gtk.Misc Subprograms::


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

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

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


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

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

procedure Set_Alignment
     (Misc               : access Gtk_Misc_Record;
        Xalign             : in     Gfloat;
        Yalign             : in     Gfloat);

Modify the alignment for the widget.
Xalign and Yalign are both values between 0.0 and 1.0 that specify the
alignment: if Xalign is 0.0, the widget will be left aligned; if it is
0.5, the widget will be centered; if it is 1.0 the widget will be
right aligned. Yalign is from top (0.0) to bottom (1.0).   Both Xalign
and Yalign will be constrained to the range 0.0 .. 1.0  Note that if
the widget fills its allocated area, these two parameters  won't have
any effect.
procedure Set_Padding
     (Misc               : access Gtk_Misc_Record;
        Xpad               : in     Gint;
        Ypad               : in     Gint);

Set the padding (i.e. the extra spaces on the side of the widget).
If Xpad or Ypad is negative, they will be changed to 0.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Misc.

File: gtkada_rm.info,  Node: Package_Gtk.Notebook,  Next: Package_Gtk.Object,  Prev: Package_Gtk.Misc,  Up: Top

Package Gtk.Notebook
********************

A Gtk_Notebook is a container that displays all of its children at the
same location on the screen. They are organized into pages, that can be
selected through tabs (either by clicking on them or by a contextual
menu).   This is the best way to organize complicated interfaces that
have a lot  of widgets, by putting the children into groups of coherent
widgets.

* Menu:

* Gtk.Notebook Widget Hierarchy::
* Gtk.Notebook Signals::
* Gtk.Notebook Types::
* Gtk.Notebook Subprograms::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Notebook    (*note Package_Gtk.Notebook::)


File: gtkada_rm.info,  Node: Gtk.Notebook Signals,  Next: Gtk.Notebook Types,  Prev: Gtk.Notebook Widget Hierarchy,  Up: Package_Gtk.Notebook

Signals
=======

   * "switch_page"

     procedure Handler (Notebook : access Gtk_Notebook_Record'Class;
     Page     : in Gtk_Notebook_Page;
     Page_Num : Guint);
     Notify when the current page is modified in the notebook.  This is
     called every time the user selected a new page, or the program
     selected a new page with Next_Page, Prev_Page, ...



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

Types
=====

subtype Gtk_Notebook_Page is Gtk.Gtk_Notebook_Page;


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

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

Creating a notebook and inserting pages
---------------------------------------

procedure Gtk_New
     (Widget             : out    Gtk_Notebook);

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

Return the internal value associated with a Gtk_Notebook.
procedure Append_Page
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class);

Insert a new page in Notebook.
The page is put at the end of the list of pages.   The user will select
it through a button that contains the  Tab_Label widget, which is
generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   No entry is associated with the page in the contextual menu.
procedure Append_Page_Menu
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class;
        Menu_Label         : access Gtk.Widget.Gtk_Widget_Record'Class);

Insert a new page in Notebook.
The page is put at the end of the list of pages.   The user will select
it through a button that contains the  Tab_Label widget, which is
generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   A new entry is inserted into the contextual menu. This new
entry is  made with Menu_Label.
procedure Prepend_Page
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class);

Insert a new page in Notebook.
The page is put at the beginning of the list of pages.   The user will
select it through a button that contains the  Tab_Label widget, which
is generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   No entry is associated with the page in the contextual menu.
procedure Prepend_Page_Menu
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class;
        Menu_Label         : access Gtk.Widget.Gtk_Widget_Record'Class);

Insert a new page in Notebook.
The page is put at the beginning of the list of pages.   The user will
select it through a button that contains the  Tab_Label widget, which
is generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   A new entry is inserted into the contextual menu. This new
entry is  made with Menu_Label.
procedure Insert_Page
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class;
        Position           : in     Gint);

Insert a new page at a specific position in Notebook.
The page is put at the beginning of the list of pages.   The user will
select it through a button that contains the  Tab_Label widget, which
is generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   No entry is associated with the page in the contextual menu.
The first position in the list of pages is 0.
procedure Insert_Page_Menu
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class;
        Menu_Label         : access Gtk.Widget.Gtk_Widget_Record'Class;
        Position           : in     Gint);

Insert a new page at a specific position in Notebook.
The page is put at the beginning of the list of pages.   The user will
select it through a button that contains the  Tab_Label widget, which
is generally a Gtk_Label, but could be a box  with a pixmap in it for
instance.   A new entry is inserted into the contextual menu. This new
entry is  made with Menu_Label.   The first position in the list of
pages is 0.
procedure Remove_Page
     (Notebook           : access Gtk_Notebook_Record;
        Page_Num           : in     Gint);

Remove a page from the notebook.
The first position in the list of pages is 0.
function Get_Child
     (Page               : in     Gtk_Notebook_Page)
        return Gtk.Widget.Gtk_Widget;

Return the child from a page.
A page is automatically created by GtkAda when you inserted a  widget
in the notebook. The child is the widget you created itself.
Modifying and getting the current page
--------------------------------------

function Get_Current_Page
     (Notebook           : access Gtk_Notebook_Record)
        return Gint;

Get the number of the current page.
The first page has the number 0.
function Get_Cur_Page
     (Widget             : access Gtk_Notebook_Record'Class)
        return Gtk_Notebook_Page;

Return the current page.
function Get_Nth_Page
     (Widget             : access Gtk_Notebook_Record'Class;
        Page_Num           :        Gint)
        return Gtk.Widget.Gtk_Widget;

Convert from a page number to the real page.
function Page_Num
     (Widget             : access Gtk_Notebook_Record'Class;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class)
        return Gint;

Convert from a child to a page number.
Note that Child is not the notebook page, but the widget you inserted
with Insert_Page, Append_Page,...
procedure Set_Page
     (Notebook           : access Gtk_Notebook_Record;
        Page_Num           : in     Gint := -1);

Modify the current page.
The current page is the page that is currently visible on the screen.
Nothing happens if there is no such page.   Note also that the page has
to be visible on the screen (ie you must  have called Gtk.Widget.Show
on it first).   Use -1 to set the current page to the last one.
procedure Next_Page
     (Notebook           : access Gtk_Notebook_Record);

Display the next page on the screen.
procedure Prev_Page
     (Notebook           : access Gtk_Notebook_Record);

Display the previous page on the screen.
Style and visual aspect
-----------------------

procedure Set_Show_Border
     (Notebook           : access Gtk_Notebook_Record;
        Show_Border        : in     Boolean := True);

Indicate whether the notebook should display borders.
This border gives a 3D aspect to the notebook.
procedure Set_Show_Tabs
     (Notebook           : access Gtk_Notebook_Record;
        Show_Tabs          : in     Boolean := True);

Indicate whether the tabs should be displayed.
If the tabs are not displayed, the only way for the user to select a
new page is through the contextual menu, and thus you should make sure
that the pages were created with the Insert_Page_Menu, ... subprograms.
procedure Set_Tab_Pos
     (Notebook           : access Gtk_Notebook_Record;
        Pos                : in     Gtk.Enums.Gtk_Position_Type);

Change the position of the tabs.
The tabs can be display on any of the four sides of the notebook.
function Get_Tab_Pos
     (Widget             : access Gtk_Notebook_Record)
        return Gtk.Enums.Gtk_Position_Type;

Return the current position of the tabs.
procedure Set_Homogeneous_Tabs
     (Notebook           : access Gtk_Notebook_Record;
        Homogeneous        : in     Boolean := True);

Indicate whether all the tabs should have the same size (width or
height, depending on which side they are displayed on).
procedure Set_Tab_Border
     (Notebook           : access Gtk_Notebook_Record;
        Border_Width       : in     Gint);

Change the width of the tabs' borders.
This modifies both the horizontal border and the vertical border.
procedure Set_Tab_Hborder
     (Notebook           : access Gtk_Notebook_Record;
        Border_Width       : in     Gint);

Modify the width of the horizontal borders of the tabs.
procedure Set_Tab_Vborder
     (Notebook           : access Gtk_Notebook_Record;
        Border_Width       : in     Gint);

Modify the height of the vertical borders of the tabs.
procedure Set_Scrollable
     (Notebook           : access Gtk_Notebook_Record;
        Scrollable         : in     Boolean := True);

Indicate whether Notebook display scrolling arrows when there are
too many tabs.   The default is not to display such scrolling arrows.
Note also that  a notebook with too many pages, even if the scrolling
is activated,  is sometimes hard to use for the user.
Popup Menu
----------

The pages of a notebook can be selected both via tabs and a contextual
menu (right mouse button). Note however that the menu is available only
if the pages were inserted with Insert_Page_Menu, Append_Page_Menu or
Prepend_Page_Menu.

procedure Popup_Disable
     (Notebook           : access Gtk_Notebook_Record);

Disable the popup menu.
This menu won't be display any more when the user pressed the right
mouse button.
procedure Popup_Enable
     (Notebook           : access Gtk_Notebook_Record);

Enable the popup menu.
When the user pressed the right mouse button, a menu is selected that
allows him to select a new page.
Page properties
---------------

function Get_Allocation_Width
     (Page               :        Gtk_Notebook_Page)
        return Guint;

Return the current width of the page.
function Get_Allocation_Height
     (Page               :        Gtk_Notebook_Page)
        return Guint;

Return the current height of the page.
function Get_Allocation_X
     (Page               :        Gtk_Notebook_Page)
        return Gint;

Return the current position of the page, relative to its parent.
function Get_Allocation_Y
     (Page               :        Gtk_Notebook_Page)
        return Gint;

Return the current position of the page, relative to its parent.
function Get_Tab_Label
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class)
        return Gtk.Widget.Gtk_Widget;

Return the widget displayed in the tab used to select Page.
This widget is in fact the one given in argument to Insert_Page,etc.
when the page was created.
function Get_Tab_Label
     (Page               :        Gtk_Notebook_Page)
        return Gtk.Widget.Gtk_Widget;

Same as the previous function, but this applies on a specific page,
which you can get for instance as the result of Get_Cur_Page.
procedure Set_Tab_Label
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Label          : access Gtk.Widget.Gtk_Widget_Record'Class);

Modify the widget displayed in the tab for the page that contains Child.
Tab_Label is generally a Gtk_Label, although it can also be a Gtk_Box
that contains a Gtk_Pixmap and a Gtk_Label if you want to show pixmaps.
procedure Set_Tab_Label_Text
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Tab_Text           : in     String);

Modify the text displayed in the tab for the page that contains Child.
This is a less general form of Set_Tab_Label above.
function Get_Menu_Label
     (Page               : in     Gtk_Notebook_Page)
        return Gtk.Widget.Gtk_Widget;

Return the widget displayed in the contextual menu for the page.
This is the widget given in argument to Insert_Page_Menu,
Append_Page_Menu and Prepend_Page_Menu
procedure Set_Menu_Label
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Menu_Label         : access Gtk.Widget.Gtk_Widget_Record'Class);

Modify the widget displayed in the contextual menu for the page
that contains Child.
procedure Set_Menu_Label_Text
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Menu_Text          : in     String);

Modify the text displayed in the contextual menu for the page that
contains Child.   This is a less general form of Set_Menu_Label above.
procedure Query_Tab_Label_Packing
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Expand             : out    Boolean;
        Fill               : out    Boolean;
        Pack_Type          : out    Gtk.Enums.Gtk_Pack_Type);

Return the packing used for the tab associated with the page
that contains Child.   See the Gtk.Box package for more information on
the parameters.
procedure Set_Tab_Label_Packing
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Expand             : in     Boolean;
        Fill               : in     Boolean;
        Pack_Type          : in     Gtk.Enums.Gtk_Pack_Type);

Modify the packing used for the tab associated with the page that
contains Child.
procedure Reorder_Child
     (Notebook           : access Gtk_Notebook_Record;
        Child              : access Gtk.Widget.Gtk_Widget_Record'Class;
        Position           :        Gint);

Change the position of the page that contains Child.
List of pages
-------------

function Get_Children
     (Widget             : access Gtk_Notebook_Record)
        return Page_List.Glist;

Return the list of all pages in the notebook.

File: gtkada_rm.info,  Node: Package_Gtk.Object,  Next: Package_Gtk.Option_Menu,  Prev: Package_Gtk.Notebook,  Up: Top

Package Gtk.Object
******************

This is the base class of the widget hierarchy.   Everything in GtkAda
inherits from this class Gtk_Object, except for a few  structures in
the Gdk.* packages (low-level drawing routines).

   This class provides a set of handful features that you can choose to
reuse  in your applications:

   * Reference counting: an object is not deleted while there exists at
     least    one reference to it. Although GtkAda mostly takes care of
     that aspect    transparently, you might need in some obscure cases
     to increment or    decrement the reference counting for a widget
     manually, so that it is not    removed from memory while you still
     need it.

   * User data: any number of data can be attached to a Gtk_Object or
     one of    its children. Theses data are references by a String, in
     a hash-table.     GtkAda itself uses this feature to provide an
     easy conversion between C    and Ada widgets.     Although you
     might prefer to have a completely object-oriented    application
     (and thus associate data through class inheritance), it    might
     be convenient to directly attach some data to your objects.

   * It also contains the basic structures and subprograms required for
     signal    emission. This is of course used to implement the signal
     mechanism in    GtkAda itself, but can also be used to implement a
     Model/View/Controller    framework.

    Note that a lot of functions provided in the C interface are not
provided  here. They are used to emulate an object-oriented language in
C, which can  of course be done much more conveniently in Ada.
Therefore most of these  functions are not needed.

   Here is a brief explanation on how the reference counting and
destruction  process work. You should not have to understand all this
to use GtkAda, but  it might help anyway.

   When an object (descendant of Gtk.Object) is created, it has
initially a  ref_count of 1. A flag is set to say the object is
"floating".  See the  Flags functions in this package for how to
retrieve the status of this  flag.

   When the object gets a parent (ie Gtk.Widget.Set_Parent is called,
possibly  from other subprograms like Gtk.Container.Add,
Gtk.Box.Pack_Start, ...),  the ref_count of the object is incremented
to 2.   If the object was still "floating", it is also "sinked", ie its
ref_count  is decremented to 1, and the "floating" flag is cleared.

   The same behavior as above happens when the object is registered as a
top-level widget (i.e. we know it won't have any parent).

   Thus the normal life cycle of an object is to have a ref_count to 1,
and  not be a "floating" object.

   When the object is destroyed, the following happens:     A temporary
reference to the object is created (call to Ref), and        ref_count
to 2.      The object is shutdown:        It is removed from its parent
(if any), and its ref_count is          decremented to 1.         The
"destroy" signal is emitted, the user's handlers are called,
and then all the handlers connected to the object are destroyed.
The object is unref-ed. If its ref_count goes down to 0 (normal case),
     the memory used by the object and its user_data is freed.

* Menu:

* Gtk.Object Widget Hierarchy::
* Gtk.Object Signals::
* Gtk.Object Types::
* Gtk.Object Subprograms::


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)


File: gtkada_rm.info,  Node: Gtk.Object Signals,  Next: Gtk.Object Types,  Prev: Gtk.Object Widget Hierarchy,  Up: Package_Gtk.Object

Signals
=======

   * "destroy"

     procedure Handler (Object : access Gtk_Object_Record'Class);
     Raised when the object is about to be destroyed. The "destroyed"
     flag has been set on the object first. Handlers should not keep a
     reference on the object.  Note that when your destroy handlers are
     called, the user_data is still available.  The default
     implementation destroys all the handlers.



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

Types
=====

type Signal_Parameter_Types is array (Natural range <>, Natural range <>) of Gtk_Type;

The description of the parameters for each event.   Each event defined
with Initialize_Class_Record below should have an  entry in this table.
If Gtk_Type_None is found in the table, it is  ignored. For instance, a
Signal_Parameter_Type like:  (1 => (1 => Gdk_Type_Gdk_Event, 2 =>
Gdk_Type_Nonde),  2 => (1 => Gdk_Type_Int,       2 => Gdk_Type_Int));
defines two signals, the first with a single Gdk_Event parameter, the
second with two ints parameters.

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

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

procedure Ref
     (Object             : access Gtk_Object_Record);

Increment the reference count on the object.
Since an object is not deleted while its reference count is not null,
this is a way to keep an object in memory.   GtkAda mostly takes care
of everything, and you should not need this  function except in special
cases.
procedure Unref
     (Object             : access Gtk_Object_Record);

Decrement the reference count for an object.
If it passed from 1 to 0, then the memory allocated for the object is
freed, and the object no longer usable.   It is better to use Destroy
than Unref to destroy an object, although  both might be acceptable.
procedure Sink
     (Object             : access Gtk_Object_Record);

Sink the object.
If the object is floating (does not have a parent yet), it is unref-ed
once and the floating flag is cleared.
procedure Destroy
     (Object             : access Gtk_Object_Record);

Destroy the object.
This emits a "destroy" signal, calls all your handlers, and then
unconnects them all. The object is then unref-ed, and if its reference
count goes down to 0, the memory associated with the object and its
user data is freed.   Note that when you destroy handlers are called,
the user_data is still  available.
function Get_Type              return Gtk.Gtk_Type;

Return the internal value associated with a Gtk_Object internally.
function Get_Type
     (Object             : access Gtk_Object_Record)
        return Gtk_Type;

Return the type of Object.
This function is mostly used internally, since in Ada you can simply
test whether an object belong to a class with a statement like:

   if Object in Gtk_Button_Record'Class then ...

   which is easier.
Flags
-----

Each object is associated with a set of flags, that reports the state
of the object.   The following flags are known by all objects:

   * "Destroyed":     Set if the object is marked as destroyed (if its
     reference count is     not yet 0, the memory has not been freed,
     but you should not use it     anyway).

   * "Floating":     The object has no parent yet, since it was just
     created. Its     reference count is still 1 (as it was initially).
     This flag is     cleared as soon as Set_Parent is called on the
     widget or the widget     is qualified as a toplevel widget (see
     Gtk.Container.Register_Toplevel).

   * "Connected":     Set if the object is connected to at least one
     handler

   * "Constructed":     Set if the object has been fully constructed,
     and is now usable.      Every time you create an object at the
     GtkAda level, the object will     be fully constructed, and you
     shouldn't have to worry about that     flag.

function Flags
     (Object             : access Gtk_Object_Record)
        return Guint32;

Return the flags that are set for the object, as a binary mask.
procedure Set_Flags
     (Object             : access Gtk_Object_Record;
        Flags              : in     Guint32);

Set some specific flags for the object.
Flags is a mask that will be added to the current flags of the object.
procedure Unset_Flags
     (Object             : access Gtk_Object_Record;
        Flags              : in     Guint32);

Unset some specific flags for the object.
Flags is a mask that will be deleted from the current flags of the
object.
function Flag_Is_Set
     (Object             : access Gtk_Object_Record;
        Flag               : in     Guint32)
        return Boolean;

Return True if the specific flag Flag is set for the object.
function Destroyed_Is_Set
     (Object             : access Gtk_Object_Record'Class)
        return Boolean;

Test if the Destroyed flag is set for the object.
function Floating_Is_Set
     (Object             : access Gtk_Object_Record'Class)
        return Boolean;

Test if the Floating flag is set for the object.
function Connected_Is_Set
     (Object             : access Gtk_Object_Record'Class)
        return Boolean;

Test if the Connected flag is set for the object.
function Constructed_Is_Set
     (Object             : access Gtk_Object_Record'Class)
        return Boolean;

Test if the Constructed flag is set for the object
Creating new widgets
--------------------

These types and functions are used only when creating new widget types
directly in Ada. These functions initialize the classes so that they are
correctly recognized by gtk+ itself  See the GtkAda user's guide for
more information on how to create your  own widget types in Ada.

procedure Initialize_Class_Record
     (Object             : access Gtk_Object_Record'Class;
        Signals            :        Gtkada.Types.Chars_Ptr_Array;
        Class_Record       : in out System.Address;
        Parameters         :        Signal_Parameter_Types
                            := Null_Parameter_Types;
        Scroll_Adjustments_Signal  :        Guint := 0);

Create the class record for a new widget type.
It is associated with Signals'Length new signals. A pointer to the
newly created structure is also returned in Class_Record.   If
Class_Record /= System.Null_Address, no memory allocation is
performed, we just reuse it.   Note: The underlying C widget must
already have been initialized  by a call to its parent's Initialize
function.   Parameters'Length should be the same as Signals'Length, or
the result  is undefined.   As a special case, if Parameters has its
default value, all signals are  created with no argument. This is done
for backward compatibility  mainly, and you should instead give it an
explicit value.

   Scroll_Adjustments_Signal is the index of the new signal that will be
emitted when Gtk.Widget.Set_Scroll_Adjustments is called. If it is 0,
no signal is emitted. The first signal in Signals has index 1. Note
that the handlers for this signal take two arguments in addition to the
widget (the horizontal and vertical adjustments to be used). See
Gtk.Scrolled_Window and Gtk.Widget.Set_Scroll_Adustment for more
information on this signal.

   Only the signals with no parameter can be connected from C. However,
any signal can be connected from Ada. This is due to the way we define
default marshallers for the signals.

File: gtkada_rm.info,  Node: Package_Gtk.Option_Menu,  Next: Package_Gtk.Packer,  Prev: Package_Gtk.Object,  Up: Top

Package Gtk.Option`_'Menu
*************************

A GtkOptionMenu is a widget that allows the user to choose from a list
of  valid choices. The GtkOptionMenu displays the selected choice. When
activated, the GtkOptionMenu displays a popup GtkMenu which allows the
user to make a new choice.

* Menu:

* Gtk.Option_Menu Widget Hierarchy::
* Gtk.Option_Menu Subprograms::


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

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_Option_Menu (*note Package_Gtk.Option_Menu::)


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

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

procedure Gtk_New
     (Option_Menu        : out    Gtk_Option_Menu);

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

Return the internal value associated with a Gtk_Option_Menu.
function Get_Menu
     (Option_Menu        : access Gtk_Option_Menu_Record)
        return Gtk.Menu.Gtk_Menu;

Return the Gtk_Menu associated with the Gtk_Option_Menu.
procedure Set_Menu
     (Option_Menu        : access Gtk_Option_Menu_Record;
        Menu               : access Widget.Gtk_Widget_Record'Class);

Provide the Gtk_Menu that is popped up to allow the user to choose a new
value. You should provide a simple menu avoiding the use of tearoff menu
items, submenus, and accelerators.
procedure Remove_Menu
     (Option_Menu        : access Gtk_Option_Menu_Record;
        Menu               : access Widget.Gtk_Widget_Record'Class);

Remove the menu from the option menu.
procedure Set_History
     (Option_Menu        : access Gtk_Option_Menu_Record;
        Index              : in     Gint);

Select the menu item specified by index making it the newly selected
value for the option menu.

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

Package Gtk.Packer
******************

A Gtk_Packer is a container that organizes its children according  to a
given location (North, East, South, West or any combination of  them).

   The children can be set to expand and/or fill their assigned
location.

* Menu:

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


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

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

     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Container      (*note Package_Gtk.Container::)
              \___ Gtk_Packer      (*note Package_Gtk.Packer::)

