comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: gtkada evenhandler on_procedure method , how to access children of topwindow in the eventhandler
Date: Sat, 2 Nov 2019 17:18:38 +0100
Date: 2019-11-02T17:18:38+01:00	[thread overview]
Message-ID: <qpka8u$1kkc$1@gioia.aioe.org> (raw)
In-Reply-To: 24540edc-eb1d-40d4-99ab-7ff54c5e61d6@googlegroups.com

On 2019-11-02 16:27, Alain De Vos wrote:

> In the main program I can have,
> MyVBox.Button.On_Clicked (Call => On_Button_Click'Access, Slot => Top);
> MyVBox.Button.On_Clicked (Call => On_Button_Click'Access, Slot => MyVBox);
> with
> Top     : Gtk.Window.Gtk_Window;
> MyVBox  : MyVBoxT;
> Both work fine,
> 
> In handler i can have,
> procedure On_Button_Click (Top : access Glib.Object.GObject_Record'Class),
> this works fine,
> But when i try :
> procedure On_Button_Click (MyVBox : access Gtk_Button_Record'Class)

Because Gtk_Button_Record'Class and GObject_Record'Class are two 
different types. On_Clicked with Slot parameter require downcasting, 
which is why you should use Gtk.Handlers.User_Callback instead.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2019-11-02 16:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02 10:22 gtkada evenhandler on_procedure method , how to access children of topwindow in the eventhandler Alain De Vos
2019-11-02 11:00 ` Alain De Vos
2019-11-02 11:03 ` Dmitry A. Kazakov
2019-11-02 15:27 ` Alain De Vos
2019-11-02 16:18   ` Dmitry A. Kazakov [this message]
2019-11-02 19:07 ` Alain De Vos
2019-11-02 19:21   ` Dmitry A. Kazakov
2019-11-02 22:03 ` Alain De Vos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox