From: "Bernie Rossi" <bernie@adam.com.au>
Subject: Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings)
Date: 1996/08/12
Date: 1996-08-12T00:00:00+00:00 [thread overview]
Message-ID: <01bb87e1.6df84880$277c02cb@default> (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
next reply other threads:[~1996-08-12 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-12 0:00 Bernie Rossi [this message]
1996-08-13 0:00 ` Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Ted Dennison
1996-08-14 0:00 ` Paul Hussein
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