int main( int argc, char **argv ) { LCUI_Widget root, pack, btn; LCUI_Init(); root = LCUIWidget_GetRoot(); pack = LCUIBuilder_LoadFile( "helloworld.xml" ); if( !pack ) { return -1; } Widget_Append( root, pack ); Widget_Unwrap( pack ); btn = LCUIWidget_GetById( "btn" ); Widget_BindEvent( btn, "click", OnBtnClick, NULL, NULL ); return LCUI_Main(); }
int main( int argc, char **argv ) { LCUI_Widget root, box; #ifdef LCUI_BUILD_IN_WIN32 InitConsoleWindow(); #endif LCUI_Init(); LCUIDisplay_SetMode( LDM_WINDOWED ); LCUIDisplay_SetSize( 960, 540 ); box = LCUIBuilder_LoadFile("hello.xml"); if( box ) { root = LCUIWidget_GetRoot(); Widget_Append( root, box ); Widget_Unwrap( &box ); } return LCUI_Main(); }
int test_xml_parser( void ) { int ret = 0; LCUI_Widget root, pack; LCUI_Init(); TEST_LOG( "test widget layout\n" ); LCUIDisplay_SetSize( 960, 680 ); root = LCUIWidget_GetRoot(); CHECK( pack = LCUIBuilder_LoadFile( "test_xml_parser.xml" ) ); if( !pack ) { LCUI_Destroy(); return ret; } Widget_UpdateStyle( root, TRUE ); Widget_Append( root, pack ); Widget_Unwrap( pack ); LCUIWidget_Update(); ret += check_widget_attribute(); LCUI_Destroy(); return ret; }
int test_widget_inline_block_layout( void ) { int ret = 0; LCUI_Widget root, pack; LCUI_Init(); TEST_LOG( "test widget inline block layout\n" ); LCUIDisplay_SetSize( SCREEN_WIDTH, SCREEN_HEIGHT ); root = LCUIWidget_GetRoot(); CHECK( pack = LCUIBuilder_LoadFile( "test_widget_inline_block_layout.xml" ) ); if( !pack ) { LCUI_Destroy(); return ret; } Widget_UpdateStyle( root, TRUE ); Widget_Append( root, pack ); Widget_Unwrap( pack ); LCUIWidget_Update(); ret += check_layout(); LCUI_Destroy(); return ret; }