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,efc4d105e185aa1d X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Date: 1996/08/13 Message-ID: <32107A42.41C67EA6@escmail.orl.mmc.com>#1/1 X-Deja-AN: 173909045 references: <01bb87e1.6df84880$277c02cb@default> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-08-13T00:00:00+00:00 List-Id: Bernie Rossi wrote: > > 1. Trying to get a Widgetlist. > In my program I would like to modify some attributes of some > children widgets, so I need to get the widgetlist so that I > can access them. The code in 'C' is; > > WidgetList children; /* Defining a pointer to a WidgetList > */ > > XtVaGetValues(Form, XmNchildren, &children, NULL); /* Get Ptr */ ... > > When I re-write this in Ada the results are un-predicatble & wrong > causing core dumps etc. Note the problem is getting the WidgetList ... It might help if you posted the Ada code that isn't working, rather than the C that is. Someone familiar with your compiler/binding combination might be able to spot the problem right away. > 2. Trying to Override the Resize of a Widget. > The 'C' code is; > > XtActionsRec rec; /* Defining Structure */ > > rec.string = "resize"; /* Setting up of > structure */ > rec.proc = resize; > XtAppAddActions(app, &rec, 1); /* Overriding Resize actions */ > XtOverrideTranslations(Form, > XtParseTranslationTable(": resize()")); > > static void resize(w, event, args, num_args) /* Procedure to re-size */ ... > > When I re-write this code in Ada it compiles and runs without a dump > but produces a message saying something like "Action: resize not found". > So obviously I haven't defined something properly? Yes. Again it would be nice to see the _Ada_ code, but I highly suspect that you left out the appropriate pragmas for the definition of your resize procedure that would make the symbol for it visible to the outside world. Such pragmas are compiler-dependant things, and I don't know what Apex uses, so you'll have to check your compiler docs yourself to find the appropriate pragmas to use. Also, many compilers have restrictions on how procedures can be defined if they are to be externally-callable. ie: Your callback procedures may have to be declared at the top level of a package body. Again, check your compiler docs. It may help if you check the material that came with your X Bindings. There ought to be an example using callbacks or a discussion on how to code them somewhere in there. -- T.E.D. | Work - mailto:dennison@escmail.orl.mmc.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |