From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,efc4d105e185aa1d X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Date: 1996/08/13 Message-ID: #1/1 X-Deja-AN: 173956062 sender: news@organon.com (news) references: <01bb87e1.6df84880$277c02cb@default> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-08-13T00:00:00+00:00 List-Id: In article <01bb87e1.6df84880$277c02cb@default> "Bernie Rossi" 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