#NEWLINE# def main( self ) : #NEWLINE# #INDENT# self . main_container = gui . Widget ( ) #NEWLINE# self . main_container . set_size ( 1020 , 600 ) #NEWLINE# self . main_container . set_layout_orientation ( gui . Widget . LAYOUT_VERTICAL ) #NEWLINE# self . title = gui . Label ( 'Mine Field GAME' ) #NEWLINE# self . title . set_size ( 1000 , 30 ) #NEWLINE# self . title . style [ 'margin' ] = '10px' #NEWLINE# self . title . style [ 'font-size' ] = '25px' #NEWLINE# self . title . style [ 'font-weight' ] = 'bold' #NEWLINE# self . info = gui . Label ( 'Collaborative minefiled game. Enjoy.' ) #NEWLINE# self . info . set_size ( 400 , 30 ) #NEWLINE# self . info . style [ 'margin' ] = '10px' #NEWLINE# self . info . style [ 'font-size' ] = '20px' #NEWLINE# self . lblMineCount = gui . Label ( 'Mines' ) #NEWLINE# self . lblMineCount . set_size ( 100 , 30 ) #NEWLINE# self . lblFlagCount = gui . Label ( 'Flags' ) #NEWLINE# self . lblFlagCount . set_size ( 100 , 30 ) #NEWLINE# self . time_count = 0 #NEWLINE# self . lblTime = gui . Label ( 'Time' ) #NEWLINE# self . lblTime . set_size ( 100 , 30 ) #NEWLINE# self . btReset = gui . Button ( 'Restart' ) #NEWLINE# self . btReset . set_size ( 100 , 30 ) #NEWLINE# self . btReset . set_on_click_listener ( self , 'new_game' ) #NEWLINE# self . horizontal_container = gui . Widget ( ) #NEWLINE# self . horizontal_container . style [ 'display' ] = 'block' #NEWLINE# self . horizontal_container . style [ 'overflow' ] = 'auto' #NEWLINE# self . horizontal_container . set_layout_orientation ( gui . Widget . LAYOUT_HORIZONTAL ) #NEWLINE# self . horizontal_container . style [ 'margin' ] = '10px' #NEWLINE# self . horizontal_container . append ( self . info ) #NEWLINE# imgMine = gui . Image ( '/res/mine.png' ) #NEWLINE# imgMine . set_size ( 30 , 30 ) #NEWLINE# self . horizontal_container . append ( imgMine ) #NEWLINE# self . horizontal_container . append ( self . lblMineCount ) #NEWLINE# imgFlag = gui . Image ( '/res/flag.png' ) #NEWLINE# imgFlag . set_size ( 30 , 30 ) #NEWLINE# self . horizontal_container . append ( imgFlag ) #NEWLINE# self . horizontal_container . append ( self . lblFlagCount ) #NEWLINE# self . horizontal_container . append ( self . lblTime ) #NEWLINE# self . horizontal_container . append ( self . btReset ) #NEWLINE# self . minecount = 0 #NEWLINE# self . flagcount = 0 #NEWLINE# self . link = gui . Link ( 'https://github.com/dddomodossola/remi' , 'This is an example of REMI gui library.' ) #NEWLINE# self . link . set_size ( 1000 , 20 ) #NEWLINE# self . link . style [ 'margin' ] = '10px' #NEWLINE# self . main_container . append ( self . title ) #NEWLINE# self . main_container . append ( self . horizontal_container ) #NEWLINE# self . main_container . append ( self . link ) #NEWLINE# self . new_game ( ) #NEWLINE# self . display_time ( ) #NEWLINE# return self . main_container