From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,26a21b9e317dc639 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.224.189.16 with SMTP id dc16mr519508qab.0.1353577762122; Thu, 22 Nov 2012 01:49:22 -0800 (PST) Received: by 10.49.94.129 with SMTP id dc1mr4693381qeb.22.1353577762080; Thu, 22 Nov 2012 01:49:22 -0800 (PST) Path: gf5ni2982588qab.0!nntp.google.com!i9no8429086qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 22 Nov 2012 01:49:22 -0800 (PST) In-Reply-To: <1rmgkwpxhl86b$.wcpirg4sgwbv.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=136.163.203.8; posting-account=l8k8IwoAAADeDydswOzwNzmn10qOk9gt NNTP-Posting-Host: 136.163.203.8 References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <6e3f6f2d-d221-4795-9c01-9abb013442b7@googlegroups.com> <1rmgkwpxhl86b$.wcpirg4sgwbv.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2ae90983-7ad7-433f-8e79-cd9c75ca000a@googlegroups.com> Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) From: ake.ragnar.dahlgren@gmail.com Cc: mailbox@dmitry-kazakov.de Injection-Date: Thu, 22 Nov 2012 09:49:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-22T01:49:22-08:00 List-Id: On Monday, November 19, 2012 10:56:10 PM UTC+1, Dmitry A. Kazakov wrote: > On Mon, 19 Nov 2012 12:52:17 -0800 (PST), ake.ragnar.dahlgren@gmail.com w= rote: > Also it is possible to see that the callbacks are declared in the >= Simple_Callbacks package. Note that the methods are not instance member > = methods. GtkAda package Gtk.Handlers provides generic package User_Callback= which does all you need. It is the recommended way to pass additional para= meters to Gtk event handlers. GValue objects could be used to pass more tha= n one parameter etc. > I hope I am wrong but it seems to me that since Ada = lacks the ability to > create pointers (maybe access types are the right wo= rds) to instance > member methods, it is not possible to take advantage of = Ada's OOP features > when developing Glade3 applications. I doubt that this= would be useful with Gtk anyway. Closures would require special treatment = in order to marshal them to Gtk handlers. There is a complex infrastructure= in Gtk for dealing with closures. It is based on plain pointers. If Ada pr= ovided fat pointers (access types) for object+primitive operation closures = these would be incompatible with Gtk closures anyway. And you would get acc= essibility checks failed most of the time. Closures themselves is a huge pr= oblem when refer to dynamic objects. You should not pass any objects this w= ay which are not reference-counted by the means of gobject. If you do Ada o= bjects you should really be sure that the object is not destructed before h= andler is called. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.d= e I could not follow all the details of your explanation of closures. But I t= hank you. And you thank you for the guidelines on using Gtkada. Best regards, =C5ke Ragnar Dahlgren