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,start X-Google-Attributes: gid103376,public From: "Bernie Rossi" Subject: Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Date: 1996/08/12 Message-ID: <01bb87e1.6df84880$277c02cb@default>#1/1 X-Deja-AN: 173594630 organization: Rossi's Computer newsgroups: comp.lang.ada Date: 1996-08-12T00:00:00+00:00 List-Id: 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(": 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