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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa1d6d9edff38204 X-Google-Attributes: gid103376,public From: vonhend@ibm.net Subject: Re: Ada '83 X widget bindings Date: 1998/04/10 Message-ID: <352e40d5.0@news1.ibm.net>#1/1 X-Deja-AN: 342778578 References: <6gignr$m4g@news.man.fs.lmco.com> X-Notice: should be forwarded in their entirety to postmaster@ibm.net X-Trace: 10 Apr 98 15:55:01 GMT, 32.100.169.229 Organization: IBM.NET Reply-To: vonhend@ibm.net Newsgroups: comp.lang.ada Date: 1998-04-10T00:00:00+00:00 List-Id: The fact that Ada 83 doesn't support function pointers doesn't mean that you can't use conventional Xt and Motif bindings. We use the Verdix-supplied bindings from the Free Software Foundation (originally developed by DEC) and they work just fine. We do have to instantiate an unfortunate number of unchecked conversion functions (something I personally don't like, as unchecked conversion defeats the purpose and value of strong type checking.) The following code fragment, extracted from a working procedure, demonstrates one way to create a button and register a callback. The code which sets the resources for the button has been omitted. with Xt; with Xm_Push_Button; with Xm_String_Defs; procedure Create_Some_Dialog is function Create_Playback_Control_Form(Parent : in Xt.Widget) return Xt.Widget; ClosePushButton : Xt.Xt_Widget := Xt.Null_Widget; PlaybackControlForm : Xt.Xt_Widget := Xt.Null_Widget; Args : Xt.Xt_Ancillary_Types.Xt_Arg_List(1..256); begin ClosePushButton := Xm_Push_Button.Xm_Create_Push_Button(Parent => PlaybackControlForm, Name => "closePushButton", An_Arg_List => args(1..ac-1)); Xt.Xt_Callbacks.Xt_Add_Callback(Object => ClosePushButton, Callback_Name => Xm_String_Defs.Xm_N_Activate_Callback, Callback => Xt.Xt_Callback_Proc(Close_Dialog_CB'Address), Client_Data => Xt.Xt_Utilities.To_Xt_Pointer (PlaybackControlForm)); Xt.Xt_Composite_Management.Xt_Manage_Child(ClosePushButton); end; So you really do not need function pointers in Ada. Mark Von Hendy Lockheed Martin Technical Operations In <6gignr$m4g@news.man.fs.lmco.com>, jack.ottofaro@lmco.com (Jack Ottofaro) writes: > >We currently have Ada '83 software which uses an X11 bindings package. We'd like >to enhance our GUI with buttons, menu pulldowns, etc. Any suggestions on a good >set of X11 widget bindings, for example bindings to Motif, compatable with Ada >'83. My understanding is that since I'm using Ada '83 I cannot use the Motif >callbacks since the language does not support function pointers but a package >that provides routines for drawing widgets would be great. > >Thanks in advance, >Jack Ottofaro