[macro] TemplateMacro: move init to constructor

This commit is contained in:
2019-11-19 21:53:33 +03:00
parent a768e75cec
commit a6ff04fd1b
6 changed files with 40 additions and 32 deletions

View File

@@ -17,7 +17,8 @@ import haxework.view.group.VGroupView;
@:view var switcher:FrameSwitcher;
@:view var tabs:ButtonGroup<String>;
private function init():Void {
public function new():Void {
super();
switcher.change("list");
}

View File

@@ -10,9 +10,6 @@ import haxework.view.SpriteView;
public function new() {
super("test_layout");
}
public function init():Void {
resize();
content.addEventListener(MouseEvent.CLICK, function(_) {
resize();

View File

@@ -23,7 +23,8 @@ class FontLabelView extends LabelListItem<ThemeFont> {
@:view var fonts:ListView<ThemeFont>;
private function init():Void {
private function new():Void {
super();
var values:Array<ThemeFont> = Font.enumerateFonts(true).map(function(font:Font) {
return {
name: font.fontName,