[gtkada] Addressing external data in a GUI

Preben Randhol randhol+gtkada at pvv.org
Tue Jun 14 08:32:20 CEST 2005


On Tue, Jun 14, 2005 at 09:28:15AM +0800, Rick Duley wrote:
> --==========
> I have a Gtk_Entry within a Box, within a Frame, within a Box, within a 
> Toplevel
> Window thus:
> 
> +---------- Window ------------+
> | +--------- VBox -----------+ |
> | | +---- Frame&Label -----+ | |
> | | | +----- HBox -------+ | | |
> | | | | +--------------+ | | | |
> | | | | |    Entry     | | | | |
> | | | | +--------------+ | | | |
> | | | +------------------+ | | |
> | | +----------------------+ | |
> | +--------------------------+ |
> +------------------------------+
> 
> Here is a code segment:
> 
>    procedure On_Analyse60_Source_Folder_Entry_Changed
>      (Object : access Gtk_Entry_Record'Class)
>    is
>       Main_Window : Gtk_Window := Get_Parent_Window(Widget => Object);
>    begin
>       . . .

Why do you want to use Get_Parent_Window?

If you look at the ref. manual it says:


   function Get_Parent_Window
     (Widget : access Gtk_Widget_Record) return Gdk.Window.Gdk_Window;
   --  Return the widget's parent window.

As you can see it returns a Gdk_Window

use this:

   function Get_Toplevel (Widget : access Gtk_Widget_Record) return Gtk_Widget;
   --  Return the toplevel ancestor of the widget.
   --  This is the window or dialog in which the widget is included.
   --  The widget returned does not have any parent.

-- 
Preben Randhol -------------- http://www.pvv.org/~randhol/Ada95 --
                 «For me, Ada95 puts back the joy in programming.»



More information about the gtkada mailing list