init layout and canvas