program dislin_widgets;

uses
   dislin;

var
   ip, id, id_fil, id_lis, id_but1 : int32;
   ib1, ib2, ilis, id_but2, id_scl : int32;
   xscl				   : double;
   cl1, cfil     		   : AnsiString;

begin
   
   cl1 := 'Item1|Item2|Item3|Item4|Item5';
   SetLength (cfil, 257);
   
   swgtit ('Widgets Example');
   ip := wgini  ('VERT');

   id := wglab  (ip, 'File Widget:');
   id_fil := wgfil (ip, 'Open File', ' ', '*.c');

   id := wglab  (ip, 'List Widget:');
   id_lis := wglis (ip, cl1, 1); 

   id := wglab  (ip, 'Button Widgets:');
   id_but1 := wgbut (ip, 'This is Button 1', 0); 
   id_but2 := wgbut (ip, 'This is Button 2', 1);

   id := wglab  (ip, 'Scale Widget:');
   id_scl := wgscl (ip, ' ', 0., 10., 5., 1); 
   wgfin ();

   gwgfil (id_fil, cfil);
   ilis := gwglis (id_lis);
   ib1  := gwgbut (id_but1);
   ib2  := gwgbut (id_but2);
   xscl := gwgscl (id_scl);

   writeln ('File Widget   : ', cfil);
   writeln ('List Widget   : ', ilis);
   writeln ('Button Widgets: ', ib1, ', ', ib2);
   writeln ('Scale Widget  : ', xscl);
end.
