10

Menu Demo Program

Here is a more complicated program, menu_demo.p, that makes a window and a panel with a menu button. The choices displayed are: Option 1, Option2, and Option 3.

program MenuDemo(output);

#include "stddefs_p.h" #include "attrgetset_p.h"

var

 

base_frame

: Frame;

base_panel

: Panel;

button

: Panel_button_item;

menu

: Menu;

frame_label

: string;

button_label

: string;

option1

: Cstringp;

option2

: Cstringp;

option3

: Cstringp;

procedure menu_proc(menu_: Menu; menu_item: Menu_item); var

menu_string : Cstringp; begin

menu_string := get_MENU_STRING(menu_item);

set_FRAME_RIGHT_FOOTER(base_frame, menu_string^); end;

begin

frame_label := 'FRAME LABEL'; button_label := 'BUTTON LABEL'; new(option1); option1^ := 'OPTION 1'; new(option2); option2^ := 'OPTION 2'; new(option3); option3^ := 'OPTION 3';

xv_init(0);

The XView Toolkit

231

Page 255
Image 255
HP SunSoft Pascal 4.0 manual Menu Demo Program, XView Toolkit 231