From: vonhend@ibm.net
Subject: Re: Ada '83 X widget bindings
Date: 1998/04/10
Date: 1998-04-10T00:00:00+00:00 [thread overview]
Message-ID: <352e40d5.0@news1.ibm.net> (raw)
In-Reply-To: 6gignr$m4g@news.man.fs.lmco.com
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
next prev parent reply other threads:[~1998-04-10 0:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-09 0:00 Ada '83 X widget bindings Jack Ottofaro
1998-04-09 0:00 ` Thomas Hood
1998-04-10 0:00 ` vonhend [this message]
1998-04-10 0:00 ` Larry Kilgallen
1998-04-11 0:00 ` Christopher Green
1998-04-22 0:00 ` Rex Reges
1998-04-23 0:00 ` Larry Kilgallen
1998-04-17 0:00 ` Jean-Claude MAHIEUX
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox