The XView Toolkit
227
10
Coding Fragment
Here is an example that illustrates the style of programming with the XView
interface in Pascal. This program:
•
Creates a vertical scrollbar with a view length of 100 pixels
•
Changes the view length to 200 pixels
•
Destroys the scrollbar
In this example:
•
bar
is declared to be of type
Scrollbar
.
•
xv_create()
and
xv_create_l()
are invoked as functions.
•
set SCROLLBAR_VIEW_LENGTH ()
is invoked as a procedure.
•
xv_destroy()
is invoked as a procedure.
Conversion of C to Pascal
Here is an example of a problem that you may encounter when converting C to
Pascal. It recommends some changes that you can make to work around the
problem.
An Example
The Problem
—Besides the six standard generic procedures, there are
approximately 80 other procedures, plus hundreds of attributes. These are all
documented in the XView Programming Manual. The problem is that all of the
coding is in C.
var bar, pi: Scrollbar;
begin
bar := xv_create ( 0, SCROLLBAR, 0 );
pi := xv_create_l ( 0, SCROLLBAR,
attr_create_list_4s ( SCROLLBAR_VIEW_LENGTH, 100,
SCROLLBAR_DIRECTION, SCROLLBAR_VERTICAL));
set_SCROLLBAR_VIEW_LENGTH( bar, 200 );
xv_destroy ( bar );
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......