~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/extra/newt/newt3.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
program newt3;
 
2
 
 
3
uses newt;
 
4
 
 
5
 
 
6
var
 
7
 
 
8
    form, labelC, entry, button : newtComponent;
 
9
    S: ansiString;
 
10
    P: Pchar;
 
11
    machaine :string;
 
12
begin
 
13
 
 
14
    newtInit();
 
15
    newtCls();
 
16
 
 
17
    newtOpenWindow(10, 5, 40, 8, 'Entry and Label Sample');
 
18
 
 
19
    labelC := newtLabel(1, 1, 'Enter a string');
 
20
 
 
21
    p:=addr(machaine[1]);
 
22
    s:='Sample';
 
23
    entry := newtEntry(16,1,PChar(S),20,@P,NEWT_FLAG_SCROLL OR NEWT_FLAG_RETURNEXIT);
 
24
 
 
25
 
 
26
    button := newtButton(17, 3, 'Ok');
 
27
    form := newtForm(NiL, NiL, 0);
 
28
    newtFormAddComponents(form, labelC, entry, button, NiL);
 
29
 
 
30
    newtRunForm(form);
 
31
 
 
32
    newtFinished();
 
33
 
 
34
    writeln('Final string was:'+ strPas(P));
 
35
 
 
36
    (* We cannot destroy the form until after we've used the value
 
37
       from the entry widget. *)
 
38
    newtFormDestroy(form);
 
39
end.