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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8b7e315279c3f417 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.82.103 with SMTP id h7mr365350pay.11.1355845019246; Tue, 18 Dec 2012 07:36:59 -0800 (PST) Path: s9ni51875pbb.0!nntp.google.com!news.glorb.com!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.x-privat.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Library, called, returns and continues ? Date: Tue, 18 Dec 2012 16:37:46 +0100 Organization: cbb software GmbH Message-ID: <1e0o0otix7lpu$.sw1iytsyjxg2.dlg@40tude.net> References: <5ced9166-5a29-4ad2-8270-6d24ddd0d0a1@googlegroups.com> <1rz66cdo8v1hv.j9eyg9eqqide$.dlg@40tude.net> <87db4d95-56ce-4254-8031-7bbbea515ff3@googlegroups.com> <3bb4c9f9-7317-46c2-8ddf-a80a6706ce65@googlegroups.com> <6f3c34d9-504a-494c-9157-2cf2649e4776@googlegroups.com> <1i2sghp4ue0mm.1kozrtpxq33n1.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-12-18T16:37:46+01:00 List-Id: On Tue, 18 Dec 2012 07:00:41 -0800 (PST), Patrick wrote: > To pick one at random: > Cal : access Gtk_Calendar_Record'Class > > Now I know this is a pointer to a C object but only because I basically get C/C++ now. No it is a pointer to an Ada object associated with the C object implementing the Gtk widget. GtkAda creates an Ada object for each Gtk widget (and any other object) created by means of GtkAda. This object is used as a proxy to the native C object when calls are made from Ada side. It must be this way because Gtk has object-oriented design. Gtk was developed with interoperability to other languages in mind. Many GUI frameworks use a similar technique, when the widget carries an opaque pointer to some user data. C to Ada path works as follows. Gtk callbacks are captured by private GtkAda's subroutines. They must exist anyway, since C convention is required. These get the pointer to XXX_Record'Class from the C object and route the call to the corresponding primitive operation of the Ada object. The user need not know all this mechanics. Everything looks like calling Ada operations and Ada operations being called. > If there was a simple little Ada widget toolkit that only had a C/C++ > core, Meaning? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de