bright-gpu-74537
06/14/2022, 5:58 PMbright-gpu-74537
06/14/2022, 5:58 PMtall-teacher-57409
06/14/2022, 6:06 PMhaxe
var button1 = new Button();
var button2 = new Button();
button1.onClick = function(e) {
button1.text = "Thanks!";
}
button2.onClick = function(e) {
button1.text = "Thanks!";
}
addComponent(button1);
addComponent(button2);
Is that right? Just ignoring XML for nowbright-gpu-74537
06/14/2022, 6:06 PMtall-teacher-57409
06/14/2022, 6:06 PMtall-teacher-57409
06/14/2022, 6:06 PMtall-teacher-57409
06/14/2022, 6:07 PMhallowed-ocean-84954
06/14/2022, 6:09 PMbright-gpu-74537
06/14/2022, 6:10 PMhallowed-ocean-84954
06/14/2022, 6:12 PMtall-teacher-57409
06/14/2022, 6:13 PMbright-gpu-74537
06/14/2022, 6:14 PMtall-teacher-57409
06/14/2022, 6:17 PMbright-gpu-74537
06/14/2022, 6:18 PMtall-teacher-57409
06/14/2022, 6:21 PMtall-teacher-57409
06/14/2022, 6:21 PMbright-gpu-74537
06/14/2022, 6:22 PMhaxe
class MainView extends VBox {
public function new() {
super();
addComponent(new Button()).text = "Button 1";
addComponent(new Button()).text = "Button 2";
addComponent(new Button()).text = "Button 3";
}
}bright-gpu-74537
06/14/2022, 6:23 PMelegant-twilight-61392
06/14/2022, 6:27 PMsetText method or something so you could do like addComponent(...).setText('button').otherthing(...)?bright-gpu-74537
06/14/2022, 6:29 PMhaxe
beginBox()
.beginHBox()
.button().text("button 1")
.button().text("button 2")
.button().text("button 3")
.endHBox()
.endBox();
but decided it was entirely useless (and work to maintain) since you can just use xmltall-teacher-57409
06/14/2022, 8:05 PM@:build is better than ComponentMacros.buildComponenttall-teacher-57409
06/14/2022, 8:06 PMbright-gpu-74537
06/14/2022, 8:08 PMbright-gpu-74537
06/14/2022, 8:08 PMtall-teacher-57409
06/14/2022, 8:09 PMtall-teacher-57409
06/14/2022, 9:18 PMComponenthallowed-ocean-84954
06/15/2022, 1:58 AMhallowed-ocean-84954
06/15/2022, 3:02 AMframe > label and it seems like it's doing frame label. I could be wrong but it looks like that. I got it working with #id > label as a selector but element > element doesn't seem to work. Should it ?