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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ddba00b4baf322d8 X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Re: Access to primitive operations of tagged types Date: 1997/03/31 Message-ID: <33403878.2EDA@watson.ibm.com>#1/1 X-Deja-AN: 230147391 References: To: "Nigel J. Tracey" Organization: IBM Thomas J. Watson Research Center Reply-To: ncohen@watson.ibm.com Newsgroups: comp.lang.ada Date: 1997-03-31T00:00:00+00:00 List-Id: Nigel J. Tracey wrote: > I am having a go at writing a class hierarchy to interface to X-Windows/ > Motif. My idea was to have tagged types for each of the widgets in > Motif with various functions. Among these functions would be null functions > for the callbacks. The user could then derive there own type from the > widget-tagged type and over-ride these callbacks with there own custom > functions. > > My problem is however that I cannot pass an access to the callback functions > when installing the callback routine in X. > The Ada RM states that a dereference of an access-to-subprogram value is > never a dispatching call. > > Does this mean I cannot do the above? Just pass an access value designating a nondispatching "wrapper subprogram" whose body consists of a single dispatching call. (Of course the proper OO style would be to pass an access value designating the classwide type of your root widget class, but Xlib wasn't designed that way.) -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen