From c059123e90df4d438d55b454dbed9760aaa5791c Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Sun, 29 Mar 2015 22:48:11 +0800 Subject: [PATCH] updated --- test/helloworld.c | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/test/helloworld.c b/test/helloworld.c index ba2b558b..ae8413df 100755 --- a/test/helloworld.c +++ b/test/helloworld.c @@ -30,39 +30,15 @@ void onTimer( void *arg ) int main( int argc, char **argv ) { - LCUI_Surface s[4]; - LCUI_Widget widget[4]; - char str[] = "文本"; + LCUI_Widget w; InitConsoleWindow(); - LCUI_Init(800,600,0); - - s[0] = Surface_New(); - s[1] = Surface_New(); - s[2] = Surface_New(); - s[3] = Surface_New(); - Surface_Resize( s[0], 320, 240 ); - Surface_Resize( s[1], 640, 480 ); - Surface_Resize( s[2], 160, 120 ); - Surface_Resize( s[3], 80, 60 ); - Surface_Show( s[0] ); - //LCUI_MSleep(500); - Surface_Show( s[1] ); - Surface_Show( s[3] ); - Surface_Move( s[0], 320, 240 ); - Surface_Move( s[1], 640, 380 ); - Surface_Move( s[2], 800, 380 ); - Surface_Move( s[3], 1080, 600 ); - Surface_SetCaptionW( s[0], L"第一个窗口" ); - Surface_SetCaptionW( s[1], L"第二个窗口" ); - Surface_SetCaptionW( s[2], L"第三个窗口" ); - Surface_SetCaptionW( s[3], L"第四个窗口" ); - LCUITimer_Set( 1000, onTimer, s[2], FALSE ); - widget[0] = Widget_New(NULL); - widget[1] = Widget_New(NULL); - widget[2] = Widget_New(NULL); - widget[3] = Widget_New(NULL); - Widget_Show( widget[0] ); - LCUIDisplay_SetMode( LDM_SEAMLESS ); + LCUI_Init(0, 0, LDM_SEAMLESS); + w = Widget_New(NULL); + Widget_Top( w ); + Widget_Show( w ); + Widget_Resize( w, 320, 240 ); + Widget_Move( w, 480, 480 ); + Widget_SetTitleW( w, L"测试" ); return LCUI_Main(); }