230
Pascal 4.0 User’s Guide
10
Sample Program
The following program,
xview.p
, makes a window:
To compile
xview.p
and link in the necessary libraries, use the following
command-line. Replace local_library_path with the path for the Pascal XView
libraries on your system.
hostname% pc -I
local_library_path
xview.p -L$OPENWINHOME/lib \
-lpxview -lxview -lolgx -lX11
Now run the executable file:
hostname% a.out
Soon after you run the executable file, the window opens as a single frame,
with the string
Hello, World!
in the frame header.
program hello(output);
#include "stddefs_p.h"
#include "attrgetset_p.h"
var
base_frame :Frame;
base_panel :Panel;
message :Xv_panel_or_item_ptr;
text :string;
begin
text :=
'
Hello, World!
'
;
xv_init(0);
base_frame := xv_create(nil, FRAME, 0);
base_panel := xv_create(base_frame, PANEL, 0);
message := xv_create(panel, PANEL_MESSAGE, 0);
set_PANEL_LABEL_STRING(message, text);
window_main_loop(base_frame);
end. {hello}
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: ......