comp.lang.ada
 help / color / mirror / Atom feed
From: husseinp@logica.co.uk (Paul Hussein)
Subject: Re: Help ! -  Problems with Ada/X (using Apex & Axi-Serc X-Bindings)
Date: 1996/08/14
Date: 1996-08-14T00:00:00+00:00	[thread overview]
Message-ID: <4usfg2$eug@romeo.logica.co.uk> (raw)
In-Reply-To: 32107A42.41C67EA6@escmail.orl.mmc.com


Ted Dennison <dennison@escmail.orl.mmc.com> wrote:

>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("<Configure>: 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         |


I agree, please post ADA code as this is more useful. Have you spoken
to bindingd suppliers or looked in another bindings suppliers bindings
to see how they perform call. It may even be something like a non
null-terminated string. 


If the ADA is correct, it could be that you are getting a storag_error
which is manifesting itself in a sigsegv. Try upping stack size of
caller task.

Also another good approach would be to write the problem bit in C and
pragma interface to it to check that everything else is working OK.





  reply	other threads:[~1996-08-14  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-12  0:00 Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Bernie Rossi
1996-08-13  0:00 ` Ted Dennison
1996-08-14  0:00   ` Paul Hussein [this message]
1996-08-13  0:00 ` Jon S Anthony
replies disabled

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