comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@escmail.orl.mmc.com>
Subject: Re: Help ! -  Problems with Ada/X (using Apex & Axi-Serc X-Bindings)
Date: 1996/08/13
Date: 1996-08-13T00:00:00+00:00	[thread overview]
Message-ID: <32107A42.41C67EA6@escmail.orl.mmc.com> (raw)
In-Reply-To: 01bb87e1.6df84880$277c02cb@default


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         |




  parent reply	other threads:[~1996-08-13  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 ` Jon S Anthony
1996-08-13  0:00 ` Ted Dennison [this message]
1996-08-14  0:00   ` Paul Hussein
replies disabled

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