comp.lang.ada
 help / color / mirror / Atom feed
* Help ! -  Problems with Ada/X (using Apex & Axi-Serc X-Bindings)
@ 1996-08-12  0:00 Bernie Rossi
  1996-08-13  0:00 ` Ted Dennison
  1996-08-13  0:00 ` Jon S Anthony
  0 siblings, 2 replies; 4+ messages in thread
From: Bernie Rossi @ 1996-08-12  0:00 UTC (permalink / raw)



Hi,
  I'm relatively new to Ada and am having some problems trying
to convert some working X code in 'C' (my language of choice) to Ada.
I would appreciate any source or help that anyone can provide.

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 */

Now I can get/set attributes eg;

XtVaGetValues(children[0], XmNwidth, &width, NULL);  /* Get Value */
XtVaSetValues(children[1], XmNwidth, width*2, NULL); /* Set Value */

When I re-write this in Ada the results are un-predicatble & wrong
causing core dumps etc.  Note the problem is getting the WidgetList
only, I can successfully Get/Set values once I have a Widget.

2. Trying to Override the Resize of a Widget.
Due to a relatively complex window I am working on I need to be
able to control the positioning of widgets after a window resize.
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 */
CompositeWidget w;
XConfigureEvent *event;
String args[];
int *num_args;
{
  etc.
}

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?

Thanks in advance to all who reply.

Regards

Bernie Rossi
bernie@adam.com.au




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-08-14  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1996-08-13  0:00 ` Jon S Anthony

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