mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 21:32:26 +00:00
newt binding, first demo - hello world application -- noch
Former-commit-id: 034808deb8
This commit is contained in:
parent
50d44e7b62
commit
3f82522841
3 changed files with 70 additions and 0 deletions
13
src/test/newt/Makefile
Normal file
13
src/test/newt/Makefile
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
CFLAGS = "-lnewt"
|
||||||
|
export CFLAGS
|
||||||
|
|
||||||
|
VOC = /opt/voc/bin/voc
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(VOC) -s newt.Mod newttest.Mod -m
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm *.h
|
||||||
|
rm *.c
|
||||||
|
rm *.o
|
||||||
|
rm *.sym
|
||||||
43
src/test/newt/newt.Mod
Normal file
43
src/test/newt/newt.Mod
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
MODULE newt;
|
||||||
|
|
||||||
|
IMPORT SYSTEM;
|
||||||
|
|
||||||
|
TYPE Int32* = INTEGER;
|
||||||
|
Int64* = LONGINT;
|
||||||
|
|
||||||
|
PROCEDURE -Init*(): Int32
|
||||||
|
"newtInit()";
|
||||||
|
|
||||||
|
PROCEDURE -Cls*()
|
||||||
|
"newtCls()";
|
||||||
|
|
||||||
|
PROCEDURE -Finished*() : Int32
|
||||||
|
"newtFinished()";
|
||||||
|
|
||||||
|
PROCEDURE -ResizeScreen*(redraw: Int32)
|
||||||
|
"newtResizeScreen(redraw)";
|
||||||
|
|
||||||
|
PROCEDURE -WaitForKey*()
|
||||||
|
"newtWaitForKey()";
|
||||||
|
|
||||||
|
PROCEDURE -ClearKeyBuffer*()
|
||||||
|
"newtClearKeyBuffer()";
|
||||||
|
|
||||||
|
PROCEDURE -Delay*(i : Int32)
|
||||||
|
"newtDelay(i)";
|
||||||
|
|
||||||
|
PROCEDURE -DrawRootText*(left, top: Int32; VAR text: ARRAY OF CHAR)
|
||||||
|
"newtDrawRootText(left, top, text)";
|
||||||
|
|
||||||
|
PROCEDURE -PushHelpLine*(VAR text: ARRAY OF CHAR)
|
||||||
|
"newtPushHelpLine(text)";
|
||||||
|
|
||||||
|
PROCEDURE -PopHelpLine*()
|
||||||
|
"newtPopHelpLine()";
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
END newt.
|
||||||
14
src/test/newt/newttest.Mod
Normal file
14
src/test/newt/newttest.Mod
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
MODULE newttest;
|
||||||
|
|
||||||
|
IMPORT newt;
|
||||||
|
VAR i : newt.Int32;
|
||||||
|
str : ARRAY 32 OF CHAR;
|
||||||
|
BEGIN
|
||||||
|
i := newt.Init();
|
||||||
|
newt.Cls();
|
||||||
|
str := "hello world!";
|
||||||
|
newt.DrawRootText(5, 7, str);
|
||||||
|
newt.WaitForKey();
|
||||||
|
newt.Delay(30);
|
||||||
|
i := newt.Finished();
|
||||||
|
END newttest.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue