[gtkada] Addressing external data in a GUI
Rick Duley
30294025 at student.murdoch.edu.au
Tue Jun 14 08:48:11 CEST 2005
Hi Preben
I did try Get_Toplevel as I explained further down the posting. Yes,
it returns
a widget.
What I am trying to do is get access to a user-defined data structure I have
included in the Gtk_Window_Record which defines the Toplevel window. As I
showed, the widget I get from Get_Toplevel does _not_ allow me to do that.
Here's the MAIN_QUESTION_:
How do you get data into a GUI, then access it within the GUI so that the User
can alter it using the GUI, then get it out of the GUI again?
Here's the second question:
If you cannot do the things in the _MAIN_QUESTION_ then what's the use
of a GUI?
Cheers
-------------------------------------------
"Professional qualitative judgement
consists in knowing the rules
for using (or occasionally breaking)
the rules."
D. Royce Sadler
-------------------------------------------
Rick Duley
Murdoch University
School of Engineering Science
Perth, Western Australia
http://eng.murdoch.edu.au/~rick
aussie : 040 910 6049 .-_|\
o'seas : + 61 40 910 6049 / \
perth *_.-._/
v
Quoting Preben Randhol <randhol+gtkada at pvv.org>:
> 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.?
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
>
More information about the gtkada
mailing list