forked from KolibriOS/kolibrios
Add example to TCC melibc #2
git-svn-id: svn://kolibrios.org@8231 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
de1d5c1767
commit
f75ba1987d
3
programs/develop/ktcc/trunk/samples/other/melibc_example/Makefile
Executable file
3
programs/develop/ktcc/trunk/samples/other/melibc_example/Makefile
Executable file
@ -0,0 +1,3 @@
|
||||
MENUETDEV = $(abspath ../../../../../libraries/menuetlibc)
|
||||
all:
|
||||
wine kos32-tcc.exe -o hello.kex hello.c -lmelibc -I $(MENUETDEV)/include
|
32
programs/develop/ktcc/trunk/samples/other/melibc_example/hello.c
Executable file
32
programs/develop/ktcc/trunk/samples/other/melibc_example/hello.c
Executable file
@ -0,0 +1,32 @@
|
||||
#include <menuet/os.h>
|
||||
|
||||
char title[] = "Menuetlibc in TinyC";
|
||||
char string[] = "Text";
|
||||
|
||||
void draw_window(void)
|
||||
{
|
||||
// start redraw
|
||||
__menuet__window_redraw(1);
|
||||
// define&draw window
|
||||
__menuet__define_window(10,40,300,150,0x33FFFFFF,0,(__u32)title);
|
||||
// display string
|
||||
__menuet__write_text(30,10,0x80000000,string,0);
|
||||
// end redraw
|
||||
__menuet__window_redraw(2);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
draw_window();
|
||||
for (;;)
|
||||
{
|
||||
switch (__menuet__wait_for_event())
|
||||
{
|
||||
case 1:
|
||||
draw_window();
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user