[Contents] [Back] [Prev] [Up] [Next] [Forward]

# Package Gdk.Main

This package provides routines to handle initialization and set up of the Gdk library.

- Gdk.Main Subprograms

## Subprograms

    procedure Init;

| Initialize the library for use. The command line arguments are modified to reflect any arguments which were not handled. (Such arguments should either be handled by the application or dismissed).

    procedure Gdk_Exit
      (Error_Code         : in     Gint);

| Restore the library to an un-itialized state and exits the program using the "exit" system call. Error_Code is the error value to pass to "exit". Allocated structures are freed and the program exits cleanly.

    function Set_Locale            return String;

| Initialize handling of internationalization of strings. see section Package Gtkada.Intl for more details.

    procedure Set_Locale;

| Drops the string returned by the Set_Locale function;

    procedure Set_Use_Xshm
      (Use_Xshm           : in     Boolean := True);

| Set whether shared memory (when supported by the graphic server) should be used.

    function Get_Use_Xshm          return Boolean;

| Return whether shared memory on the graphic server is used.

    function Get_Display           return String;

| Return the name of the display.

    function Time_Get              return Guint32;

| Get the number of milliseconds since the library was initialized. This time value is accurate to milliseconds even though a more accurate time down to the microsecond could be returned. Note that this function is currently not supported under Win32 systems.

    function Timer_Get             return Guint32;

| Return the current timer interval. This interval is in units of milliseconds.

    procedure Timer_Set
      (Milliseconds       : in     Guint32);

| Set the timer interval. Milliseconds is the new value for the timer. As a side effect, calls to Gdk.Event.Get will last for a maximum of time of Milliseconds. However, a value of 0 milliseconds will cause Gdk.Event.Get to block indefinitely until an event is received.

    procedure Timer_Enable;

| Enable the Gdk timer.

    procedure Timer_Disable;

| Disable the Gdk timer.

    function Screen_Width          return Gint;

| Return the width of the screen.

    function Screen_Height         return Gint;

| Return the height of the screen.

    function Screen_Width_MM       return Gint;

| Return the width of the screen in millimeters.

    function Screen_Height_MM      return Gint;

| Return the height of the screen in millimeters.

    procedure Flush;

| Flush the queue of graphic events and then wait until all requests have been received and processed.

    procedure Beep;

| Emit a beep.

    procedure Key_Repeat_Disable;

| Disable the key repeat behavior.

    procedure Key_Repeat_Restore;

| Restore the key repet behavior.

    function Pointer_Grab
      (Window             : in     Gdk.Window.Gdk_Window;
       Owner_Events       : in     Boolean := True;
       Event_Mask         : in     Gdk.Types.Gdk_Event_Mask;
       Confine_To         : in     Gdk.Window.Gdk_Window
                           := Gdk.Window.Null_Window;
       Cursor             : in     Gdk.Cursor.Gdk_Cursor
                           := Gdk.Cursor.Null_Cursor;
       Time               : in     Guint32)
       return Boolean;

Grab the pointer to a specific window.

- Window is the window which will receive the grab
- Owner_Events specifies whether events will be reported as is, or relative to Window
- Event_Mask masks only interesting events
- Confine_To limits the cursor movement to the specified window
- Cursor changes the cursor for the duration of the grab
- Time specifies the time Requires a corresponding call to Pointer_Ungrab

    procedure Pointer_Ungrab
      (Time               : in     Guint32);

| Release any pointer grab.

    function Pointer_Is_Grabbed    return Boolean;

| Tell wether there is an active pointer grab in effect.

    function Keyboard_Grab
      (Window             : in     Gdk.Window.Gdk_Window;
       Owner_Events       : in     Boolean := True;
       Time               : in     Guint32)
       return Boolean;

Grab the keyboard to a specific window.

- Window is the window which will receive the grab
- Owner_Events specifies whether events will be reported as is, or relative to Window
- Time specifies the time Requires a corresponding call to Keyboard_Ungrab

    procedure Keyboard_Ungrab
      (Time               : in     Guint32);

| Release any keyboard grab.

[Contents] [Back] [Prev] [Up] [Next] [Forward]