Simple Ada-95 Question (regarding X11Ada bindings) 
Author Message
 Simple Ada-95 Question (regarding X11Ada bindings)

% QUESTION:
% How do I make something of type access A actually point to the
% first element in an array of A's?
% ---------
%
% I have found out that if I take 'Address on a variable of type
                                  ^^^^^^^^
Do you mean 'Access here?

% A that is declared as aliased I get something of the right type.
% I would like to do that  with the first element in the array,
% bu I can't make that aliased..
%

You need to declare an 'array of aliased' objects, as illustrated
by the following declarations and call to a procedure with a
simlar interface:

       type Vector_Of_Point_Type is array (X11.Signed_Int range <>)
          of aliased X.Xlib.XPoint;

       Points:  Vector_Of_Point_Type := ((C.X1, C.Y1),
                                         (C.X2, C.Y1),              
                                         (C.X2, C.Y2),
                                         (C.X1, C.Y2),
                                         (C.X1, C.Y1));
   begin
       X11.XLib.XDrawLines(
           Display,
           X11.Drawable(C.Gw.Window),
           C.Gw.Gc_Always,
           Points(Points'First)'Access,
           Points'Length,
           X11.Coordmodeorigin);

 == G. Vincent Castellano :: X/Ada WWW => http://www.*-*-*.com/
 ==  "If virtual memory did not exist, it would have                    ==
 ==     become necessary for us to invent it."                          ==



Fri, 16 Jul 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Simple Ada-95 Question (regarding X11Ada bindings)

2. Ada 95-OS2 bindings style questions

3. SQL bindings to Ada 95

4. Ada 95 X binding with Apex

5. Announcing: Ada 95 binding to Tcl/Tk

6. Ada 95 binding to OpenGL?

7. Ada 95-CGI binding available

8. Ada 95 bindings for OS/2

9. Announcing: Ada 95 binding to Tcl/Tk

10. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

11. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

12. X11Ada binding release

 

 
Powered by phpBB® Forum Software