comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
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: <JSA.96Aug13130556@alexandria> (raw)
In-Reply-To: 01bb87e1.6df84880$277c02cb@default


In article <01bb87e1.6df84880$277c02cb@default> "Bernie Rossi" <bernie@adam.com.au> writes:

> to convert some working X code in 'C' (my language of choice) to Ada.

Use the Intermetrics X/Motif bindings:

-- X11/Motif
--
http://www.inmet.com/~mg/x11ada/x11ada.html

> I would appreciate any source or help that anyone can provide.

These bindings allow you to pretty much directly copy your C stuff into
Ada.

> WidgetList children;                /* Defining a pointer to a WidgetList
> */
> 
> XtVaGetValues(Form, XmNchildren, &children, NULL);  /* Get Ptr */

In Ada:

    function "&" is new Stdarg.Concat(Xt.Intrinsic.Widget);

    Children : aliased array(1..whatever) of aliased Xt.Intrinsic.Widget;

    Xt.Intrinsic.XtVaGetValues(
	Form, Stdarg.Empty &
	Motif.Xmstrdefs.XmNchildren & Children(1)'Access & Nulst );

You can, of course, use "use" if you don't like the qualified notation.


> Now I can get/set attributes eg;

Piece o'cake:

    Width : aliased Integer;

    Xt.Intrinsic.XtVaGetValues(
	Children(1), Stdarg.Empty &
	Motif.Xmstrdefs.XmNwidth & Width'Access &
	Nulst);
    Xt.Intrinsic.XtVaSetValues(
	Children(2), Stdarg.Empty &
	Motif.Xmstrdefs.XmNwidth & Width*2 &
	Nulst);
	
> 
> 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.

I do this all the time: No problemo.


> 2. Trying to Override the Resize of a Widget.

Same sort of thing.

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





  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 [this message]
1996-08-13  0:00 ` Ted Dennison
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