1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2006 AdaCore                    -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. --  This package contains top-level subprograms that are used to initialize 
  27. --  GtkAda and interact with the main event loop. 
  28. -- 
  29. --  It also provides a set of packages to set up idle functions, timeout 
  30. --  functions, and functions to be called before and after entering the 
  31. --  main loop. 
  32. --  </description> 
  33. --  <c_version>2.8.17</c_version> 
  34.  
  35. with Gdk.Event; 
  36. with Gdk.Types; 
  37. with Gtk.Widget; 
  38. with Gtk.Object; 
  39. with Pango.Font; 
  40. with System; 
  41.  
  42. package Gtk.Main is 
  43.    pragma Elaborate_Body; 
  44.  
  45.    -------------------------------------- 
  46.    -- Initialization and exit routines -- 
  47.    -------------------------------------- 
  48.  
  49.    procedure Init; 
  50.    --  Initialize GtkAda's internal structures. 
  51.    --  This subprogram should be called before any other one in GtkAda. 
  52.    --  If GtkAda could not be initialized (no access to the display, etc.), the 
  53.    --  application exits with an error 
  54.  
  55.    function Init_Check return Boolean; 
  56.    --  Initialize GtkAda's internal structures. 
  57.    --  Return False if there was an error (no access to the display, etc.) 
  58.  
  59.    function Set_Locale return String; 
  60.    --  Read and parse the local settings, such as time format, ... 
  61.    --  Return the name of the local settings, which can also be set with 
  62.    --  the environment variable LOCALE 
  63.  
  64.    procedure Set_Locale; 
  65.    --  Read and parse the local settings, such as time format, ... 
  66.  
  67.    procedure Disable_Setlocale; 
  68.    --  Prevents Init, Init_Check and Parse_Args from automatic calling 
  69.    --  Set_Locale (LC_ALL, ""). You would want to use this function if you 
  70.    --  wanted to set the locale for your program to something other than the 
  71.    --  user's locale, or if you wanted to set different values for different 
  72.    --  locale categories. 
  73.    -- 
  74.    --  Most programs should not need to call this function. 
  75.  
  76.    function Check_Version 
  77.      (Required_Major : Guint := Gtk.Major_Version; 
  78.       Required_Minor : Guint := Gtk.Minor_Version; 
  79.       Required_Micro : Guint := Gtk.Micro_Version) 
  80.       return String; 
  81.    --  Checks that the GTK+ library in use is compatible with the given 
  82.    --  version. Generally you would pass in the constants Gtk.Major_Version, 
  83.    --  Gtk.Minor_Version, Gtk.Micro_Version as the three arguments to this 
  84.    --  function; that produces a check that the library in use is compatible 
  85.    --  with the version of GTK+ the application or module was compiled against. 
  86.    -- 
  87.    --  Compatibility is defined by two things: first the version of the running 
  88.    --  library is newer than the version 
  89.    --  required_major.required_minor.required_micro. Second the running library 
  90.    --  must be binary compatible with the version 
  91.    --  required_major.required_minor.required_micro (same major version.) 
  92.    -- 
  93.    --  This function is primarily for GTK+ modules; the module can call this 
  94.    --  function to check that it wasn't loaded into an incompatible version of 
  95.    --  GTK+. However, such a check isn't completely reliable, since the module 
  96.    --  may be linked against an old version of GTK+ and calling the old version 
  97.    --  of gtk_check_version(), but still get loaded into an application using a 
  98.    --  newer version of GTK+. 
  99.    -- 
  100.    --  Return value: %NULL if the GTK+ library is compatible with the given 
  101.    --  version, or a string describing the version mismatch. 
  102.  
  103.    function Get_Default_Language return Pango.Font.Pango_Language; 
  104.    --  Returns the Pango_Language for the default language currently in 
  105.    --  effect. (Note that this can change over the life of an 
  106.    --  application.)  The default language is derived from the current 
  107.    --  locale. It determines, for example, whether GTK+ uses the 
  108.    --  right-to-left or left-to-right text direction. 
  109.  
  110.    ----------------------------- 
  111.    -- Init and Quit functions -- 
  112.    ----------------------------- 
  113.  
  114.    type Init_Function is access procedure (Data : System.Address); 
  115.    pragma Convention (C, Init_Function); 
  116.    --  Function called just before starting the main loop. 
  117.    --  This can be registered with Init_Add below. 
  118.  
  119.    procedure Init_Add (Func : Init_Function; Data : System.Address); 
  120.    --  Register a function to be called just before starting a main loop. 
  121.    --  This function is called only once, even if a new main loop is started 
  122.    --  recursively. 
  123.  
  124.    type Quit_Handler_Id is new Guint; 
  125.    --  registration ID for functions that will be called before the 
  126.    --  main loop exits. 
  127.  
  128.    type Quit_Function is access function return Boolean; 
  129.    --  Type of function that can be called when the main loop exits. 
  130.    --  It should return False if it should not be called again when another 
  131.    --  main loop exits. 
  132.  
  133.    function Quit_Add 
  134.      (Main_Level : Guint; Func : Quit_Function) return Quit_Handler_Id; 
  135.    --  Register a new function to be called when the current main loop exits. 
  136.    --  The function will be called once when the current main loop exists. 
  137.    --  If it returns False, it will then be deleted from the list of 
  138.    --  quit functions, and won't be called again next time a main loop is 
  139.    --  exited. 
  140.    --  The function will only be called when exiting a main loop at level 
  141.    --  Main_Level. If Main_Level is 0, the function will be called for the 
  142.    --  current main_loop. 
  143.  
  144.    --  <doc_ignore> 
  145.    generic 
  146.       type Data_Type (<>) is private; 
  147.    package Quit is 
  148.       type Quit_Function is access function (Data : Data_Type) return Boolean; 
  149.  
  150.       function Quit_Add 
  151.         (Main_Level : Guint; 
  152.          Func       : Quit_Function; 
  153.          Data       : Data_Type) return Quit_Handler_Id; 
  154.  
  155.    private 
  156.       procedure Free_Data (D : System.Address); 
  157.       pragma Convention (C, Free_Data); 
  158.  
  159.       function General_Cb (D : System.Address) return Gint; 
  160.       pragma Convention (C, General_Cb); 
  161.    end Quit; 
  162.    --  !!Warning!!: This package needs to be instantiated at library level 
  163.    --  since it calls some internal functions as callback. 
  164.    --  </doc_ignore> 
  165.  
  166.    function Quit_Add_Destroy 
  167.      (Main_Level : Guint; 
  168.       Object     : access Gtk.Object.Gtk_Object_Record'Class) 
  169.       return Quit_Handler_Id; 
  170.    --  Ensure that Object is destroyed when exiting the main loop at Main_Level 
  171.    --  (or the current main loop level is 0). 
  172.  
  173.    procedure Quit_Remove (Id : Quit_Handler_Id); 
  174.    --  Remove a Quit Handler, that has been previously set by Quit_Add. 
  175.  
  176.    ------------------- 
  177.    -- The main loop -- 
  178.    ------------------- 
  179.  
  180.    function Events_Pending return Boolean; 
  181.    --  Return True if there are some events waiting in the event queue. 
  182.  
  183.    procedure Main; 
  184.    --  Start the main loop, and returns only when the main loop is exited. 
  185.    --  This subprogram can be called recursively, to start new internal 
  186.    --  loops. Each of these loops is exited through a call to Main_Quit. 
  187.    --  This is the recommended method to use when you want to popup a dialog 
  188.    --  and wait for the user answer before going any further. 
  189.    --  Note that this procedure can only be called within a single task. 
  190.  
  191.    function Main_Level return Guint; 
  192.    --  Return the level of the current main loop. 
  193.    --  Since there can be nested loops, this returns the depth of the 
  194.    --  current one, starting from 1 (0 if there is none). 
  195.  
  196.    procedure Main_Quit; 
  197.    --  Quit the current main loop. 
  198.    --  If this was the last active main loop, no more events will be processed 
  199.    --  by GtkAda. 
  200.  
  201.    function Main_Iteration (Blocking : Boolean := True) return Boolean; 
  202.    --  Do one iteration of the main loop. 
  203.    --  Blocking indicates whether GtkAda should wait for an event to be 
  204.    --  available, or simply exit if there is none. 
  205.    --  Returns True if no main loop is running (ie Main_Quite was called for 
  206.    --  the innermost main loop). 
  207.    --  When doing some heavy calculations in an application, it is recommended 
  208.    --  that you check from time to time if there are any events pending and 
  209.    --  process them, so that your application still reacts to events. 
  210.    --  To do that, you would add a loop like: 
  211.    -- 
  212.    --    while Gtk.Main.Events_Pending loop 
  213.    --        Dead := Gtk.Main.Main_Iteration; 
  214.    --    end loop; 
  215.  
  216.    procedure Do_Event (Event : Gdk.Event.Gdk_Event); 
  217.    --  Process Event as if it was in the event queue. 
  218.    --  This function should almost never be used in your own application, this 
  219.    --  is the core function for event processing in GtkAda. 
  220.    --  The user should not free Event, this is already done by GtkAda. 
  221.    -- 
  222.    --  While you should not call this function directly, you might want to know 
  223.    --  how exactly events are handled. So here is what this function does with 
  224.    --  the event: 
  225.    --  * Compress enter/leave notify events. If the event passed build an 
  226.    --    enter/leave pair together with the next event (peeked from GDK) both 
  227.    --    events are thrown away. This is to avoid a backlog of 
  228.    --    (de-)highlighting widgets crossed by the pointer. 
  229.    -- 
  230.    --  * Find the widget which got the event. If the widget can't be determined 
  231.    --    the event is thrown away unless it belongs to a INCR transaction. In 
  232.    --    that case it is passed to gtk_selection_incr_event(). 
  233.    -- 
  234.    --  * Then the event is passed on a stack so you can query the currently 
  235.    --    handled event with gtk_get_current_event(). 
  236.    -- 
  237.    --  * The event is sent to a widget. If a grab is active all events for 
  238.    --    widgets that are not in the container in the grab widget are sent to 
  239.    --    the latter with a few exceptions: 
  240.    --       - Deletion and destruction events are still sent to the event 
  241.    --         widget for obvious reasons. 
  242.    --       - Events which directly relate to the visual representation of the 
  243.    --         event widget. 
  244.    --       - Leave events are delivered to the event widget if there was an 
  245.    --         enter event delivered to it before without the paired leave event 
  246.    --       - Drag events are not redirected because it is unclear what the 
  247.    --         semantics of that would be. 
  248.    --       - Another point of interest might be that all key events are first 
  249.    --         passed through the key snooper functions if there are any. Read 
  250.    --         the description of Key_Snooper_Install if you need this 
  251.    --         feature. 
  252.    -- 
  253.    --  * After finishing the delivery the event is popped from the event stack. 
  254.  
  255.    procedure Propagate_Event 
  256.      (Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  257.       Event  : Gdk.Event.Gdk_Event); 
  258.    --  Sends an event to a widget, propagating the event to parent widgets 
  259.    --  if the event remains unhandled. Events received by GTK+ from GDK 
  260.    --  normally begin in Do_Event. Depending on the type of 
  261.    --  event, existence of modal dialogs, grabs, etc., the event may be 
  262.    --  propagated; if so, this function is used. Propagate_Event 
  263.    --  calls Gtk.Widget.Event on each widget it decides to send the 
  264.    --  event to.  So Gtk.Widget.Event is the lowest-level function; it 
  265.    --  simply emits the "event" and possibly an event-specific signal on a 
  266.    --  widget. Propagate_Event is a bit higher-level, and 
  267.    --  Do_Event is the highest level. 
  268.    -- 
  269.    --  All that said, you most likely don't want to use any of these 
  270.    --  functions; synthesizing events is rarely needed. Consider asking on 
  271.    --  the mailing list for better ways to achieve your goals. For 
  272.    --  example, use gdk_window_invalidate_rect() or 
  273.    --  gtk_widget_queue_draw() instead of making up expose events. 
  274.  
  275.    function Get_Event_Widget 
  276.      (Event : Gdk.Event.Gdk_Event) return Gtk.Widget.Gtk_Widget; 
  277.    --  Return the widget to which Event applies. 
  278.  
  279.    function Get_Current_Event return Gdk.Event.Gdk_Event; 
  280.    --  Return a copy of the event being processed by gtk+. The returned 
  281.    --  value must be freed by the caller. 
  282.    --  If there is no current event, null is returned. 
  283.  
  284.    procedure Get_Current_Event_State 
  285.      (State             : out Gdk.Types.Gdk_Modifier_Type; 
  286.       Had_Current_Event : out Boolean); 
  287.    --  If there is a current event and it has a state field, place 
  288.    --  that state field in State and set Had_Current_Event to True, otherwise 
  289.    --  to False. 
  290.  
  291.    function Get_Current_Event_Time return Guint32; 
  292.    --  If there is a current event and it has a timestamp, return that 
  293.    --  timestamp, otherwise return Gdk.Types.Current_Time 
  294.  
  295.    ---------- 
  296.    -- Keys -- 
  297.    ---------- 
  298.  
  299.    type Key_Snooper_Func is 
  300.      access function (Widget : System.Address; 
  301.                       Event  : Gdk.Event.Gdk_Event_Key; 
  302.                       Data   : System.Address) return Gboolean; 
  303.    pragma Convention (C, Key_Snooper_Func); 
  304.    --  This function is called before normal event delivery, and can be used to 
  305.    --  implement custom key event handling (for instance to create macros, or 
  306.    --  any other advanced feature). 
  307.    --  Since this is a fairly low-level function, no high-level interface is 
  308.    --  provided, and you need to convert Widget yourself to the appropriate 
  309.    --  Gtk_Widget type, with, for instance: 
  310.    --      Ada_Widget := Gtk.Widget.Convert (Widget); 
  311.    --  This function should return True to stop further event processing by 
  312.    --  gtk+ (ie no widget will receive it), or False to continue with normal 
  313.    --  event processing (for instance when you have handled the key). 
  314.  
  315.    type Key_Snooper_Id is new Guint; 
  316.  
  317.    function Key_Snooper_Install 
  318.      (Snooper   : Key_Snooper_Func; 
  319.       Func_Data : System.Address) return Key_Snooper_Id; 
  320.    --  Install a new key snooper function, which will get called before events 
  321.    --  are delivered normally. 
  322.  
  323.    procedure Key_Snooper_Remove 
  324.      (Snooper_Handler_Id : Key_Snooper_Id); 
  325.    --  Remove the snooper with the given Id 
  326.  
  327.    -------------------- 
  328.    -- Grab functions -- 
  329.    -------------------- 
  330.  
  331.    procedure Grab_Add (Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  332.    --  Add a new widget to the grab list. 
  333.    --  The widget at the front of this list gets all the events even if it does 
  334.    --  not have the focus. This feature should be used with care. 
  335.    --  If you want a whole window to get the events, it is better to use 
  336.    --  Gtk.Window.Set_Modal instead which does the grabbing and ungrabbing for 
  337.    --  you. 
  338.    --  The grab is only done for the application. Events outside the 
  339.    --  application are still sent to their respective windows. 
  340.    -- 
  341.    --  See also Gtk.Window.Gtk_Window_Group 
  342.  
  343.    procedure Grab_Remove (Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  344.    --  Remove a widget from the grab list. 
  345.  
  346.    function Grab_Get_Current return Gtk.Widget.Gtk_Widget; 
  347.    --  Return the widget that currently has the focus. 
  348.  
  349.    ----------------- 
  350.    -- Obsolescent -- 
  351.    ----------------- 
  352.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  353.    --  from future versions of gtk+ (and therefore GtkAda). 
  354.    --  To find out whether your code uses any of these, we recommend compiling 
  355.    --  with the -gnatwj switch 
  356.    --  <doc_ignore> 
  357.  
  358.    procedure Gtk_Exit (Error_Code : Gint); 
  359.    pragma Obsolescent;  --  Exit 
  360.    --  Terminate GtkAda. 
  361.    --  Deprecated, use Main_Quit instead. 
  362.  
  363.    type Idle_Handler_Id is new Guint; 
  364.    --  pragma Obsolescent (Entity => Idle_Handler_Id); 
  365.    --  Id for Idle handlers. 
  366.  
  367.    type Idle_Priority   is new Guint; 
  368.    --  pragma Obsolescent (Entity => Idle_Priority); 
  369.    --  Priorities that can be set for idle handlers. 
  370.    --  The higher the priority, the less urgent the task. Handlers whose 
  371.    --  priority is lower will be called before others. 
  372.  
  373.    Priority_High_Idle    : constant Idle_Priority := 100; 
  374.    Priority_Default_Idle : constant Idle_Priority := 200; 
  375.    Priority_Low_Idle     : constant Idle_Priority := 300; 
  376.  
  377.    type Idle_Callback is access function return Boolean; 
  378.    --  pragma Obsolescent (Entity => Idle_Callback); 
  379.    --  Function that can be called automatically whenever GtkAda is not 
  380.    --  processing events. 
  381.    --  It should return True if the function should be called again as soon 
  382.    --  as possible, False if it should be unregistered. 
  383.  
  384.    function Idle_Add 
  385.      (Cb       : Idle_Callback; 
  386.       Priority : Idle_Priority := Priority_Default_Idle) 
  387.       return Idle_Handler_Id; 
  388.    pragma Obsolescent ("Use Glib.Main.Idle_Add");  --  Idle_Add_Full 
  389.    --  Register an idle callback with no user data. 
  390.  
  391.    generic 
  392.       type Data_Type (<>) is private; 
  393.    package Idle is 
  394.       type Callback is access function (D : in Data_Type) return Boolean; 
  395.       type Destroy_Callback is access procedure (D : in out Data_Type); 
  396.  
  397.       function Add 
  398.         (Cb       : in Callback; 
  399.          D        : in Data_Type; 
  400.          Priority : in Idle_Priority := Priority_Default_Idle; 
  401.          Destroy  : in Destroy_Callback := null) 
  402.          return Idle_Handler_Id; 
  403.       pragma Obsolescent ("Use Glib.Main.Idle"); 
  404.  
  405.    private 
  406.       procedure Free_Data (D : System.Address); 
  407.       pragma Convention (C, Free_Data); 
  408.  
  409.       function General_Cb (D : System.Address) return Gint; 
  410.       pragma Convention (C, General_Cb); 
  411.    end Idle; 
  412.    --  Destroy will be called automatically just prior to the destruction of D. 
  413.    --  In particular, it is also called if the idle is destroyed through a call 
  414.    --  to Idle_Remove. 
  415.  
  416.    procedure Idle_Remove (Id : in Idle_Handler_Id); 
  417.    pragma Obsolescent ("Use Glib.Main.Idle_Remove"); --  Idle_Remove 
  418.    --  Remove an idle callback, when its Id is known. 
  419.  
  420.    type Timeout_Handler_Id is new Guint; 
  421.    --  pragma Obsolescent (Entity => Timeout_Handle_Id); 
  422.    --  Id for Timeout handlers. 
  423.  
  424.    type Timeout_Callback is access function return Boolean; 
  425.    --  pragma Obsolescent (Entity => Timeout_Callback); 
  426.    --  Function that can be called automatically at precise time intervals. 
  427.    --  It should return True if the function should be called again as soon 
  428.    --  as possible, False if it should be unregistered. 
  429.  
  430.    function Timeout_Add 
  431.      (Interval : in Guint32; 
  432.       Func : Timeout_Callback) return Timeout_Handler_Id; 
  433.    pragma Obsolescent ("Use Glib.Main.Timeout_Add");  --  Timeout_Add_Full 
  434.    --  Add a new timeout. Func will be called after Interval milliseconds. 
  435.    --  The function will be called as long as it returns True. 
  436.  
  437.    generic 
  438.       type Data_Type (<>) is private; 
  439.    package Timeout is 
  440.       type Callback is access function (D : in Data_Type) return Boolean; 
  441.       type Destroy_Callback is access procedure (D : in out Data_Type); 
  442.  
  443.       function Add 
  444.         (Interval : Guint32; 
  445.          Func     : Callback; 
  446.          D        : Data_Type; 
  447.          Destroy  : in Destroy_Callback := null) return Timeout_Handler_Id; 
  448.       pragma Obsolescent ("Use Glib.Main.Timeout"); 
  449.       --  Adds a new timeout. Func will be called after Interval milliseconds. 
  450.  
  451.    private 
  452.       procedure Free_Data (D : System.Address); 
  453.       pragma Convention (C, Free_Data); 
  454.  
  455.       function General_Cb (D : System.Address) return Gint; 
  456.       pragma Convention (C, General_Cb); 
  457.    end Timeout; 
  458.  
  459.    procedure Timeout_Remove (Id : Timeout_Handler_Id); 
  460.    pragma Obsolescent ("Use Glib.Main.Timeout_Remove");  --  Timeout_Remove 
  461.    --  Unregister a timeout function. 
  462.  
  463.    --  </doc_ignore> 
  464.  
  465. private 
  466.    pragma Import (C, Gtk_Exit, "gtk_exit"); 
  467.    pragma Import (C, Main_Level, "gtk_main_level"); 
  468.    pragma Import (C, Main_Quit, "gtk_main_quit"); 
  469.    pragma Import (C, Main, "gtk_main"); 
  470.    pragma Import (C, Idle_Remove, "gtk_idle_remove"); 
  471.    pragma Import (C, Timeout_Remove, "gtk_timeout_remove"); 
  472.    pragma Import (C, Init_Add, "gtk_init_add"); 
  473.    pragma Import (C, Quit_Remove, "gtk_quit_remove"); 
  474.    pragma Import (C, Get_Current_Event, "gtk_get_current_event"); 
  475.    pragma Import (C, Disable_Setlocale, "gtk_disable_setlocale"); 
  476.    pragma Import (C, Get_Current_Event_Time, "gtk_get_current_event_time"); 
  477.    pragma Import (C, Get_Default_Language, "gtk_get_default_language"); 
  478.    pragma Import (C, Key_Snooper_Remove, "gtk_key_snooper_remove"); 
  479.    pragma Import (C, Key_Snooper_Install, "gtk_key_snooper_install"); 
  480.  
  481.    --  The following two subprograms are specific to Win32 
  482.    --  No binding: gtk_init_abi_check 
  483.    --  No binding: gtk_init_check_abi_check 
  484.  
  485.    --  No binding: gtk_get_option_group 
  486.    --  No binding: gtk_init_with_args 
  487.    --  No binding: gtk_parse_args 
  488.    --  No binding: gtk_main_iteration 
  489.  
  490.    --  These functions are not bound, we only use gtk_idle_add_full 
  491.    --  No binding: gtk_idle_add 
  492.    --  No binding: gtk_idle_add_priority 
  493.    --  No binding: gtk_idle_remove_by_data 
  494.    --  No binding: gtk_timeout_add 
  495.  
  496.    --  This function are not bound, we only use gtk_quit_add_full 
  497.    --  No binding: gtk_quit_add 
  498.    --  No binding: gtk_quit_remove_by_data 
  499.  
  500.    --  These functions are intended as callbacks, but do not apply to GtkAda 
  501.    --  No binding: gtk_true 
  502.    --  No binding: gtk_false 
  503.  
  504.    --  These functions were never bound, and are now obsolesent anyway 
  505.    --  No binding: gtk_input_add_full 
  506.    --  No binding: gtk_input_remove 
  507.  
  508. end Gtk.Main;