full-journalist-82607
01/07/2023, 9:46 PMhaxe
package issues;
import haxe.ui.components.Label;
import haxe.ui.util.Timer;
import haxe.ui.containers.VBox;
@:xml('
<vbox width="100%" height="100%">
<label id="label"/>
</vbox>')
class A009 extends VBox {
public function new() {
super();
label.htmlText = " <b>{{LALA}}</b>"; // this works
Timer.delay(function f() {
var lab = new Label();
//addComponent(lab); if the lab is added before it works
lab.htmlText = " <b>{{LALA}}</b>"; // crashes here !
// lab.htmlText = "<b> LALA </b>"; // this works in all cases
addComponent(lab);
}, 2000);
}
}full-journalist-82607
01/07/2023, 9:47 PMbright-gpu-74537
01/07/2023, 9:48 PMfull-journalist-82607
01/07/2023, 9:49 PMbright-gpu-74537
01/07/2023, 9:49 PMbright-gpu-74537
01/07/2023, 9:49 PMfull-journalist-82607
01/07/2023, 9:50 PMfull-journalist-82607
01/07/2023, 9:51 PMfull-journalist-82607
01/07/2023, 9:55 PMfull-journalist-82607
01/08/2023, 10:49 AMbright-gpu-74537
01/08/2023, 12:39 PMfew-pizza-8232
01/08/2023, 6:04 PMComponentGraphics isn't implemented. It seems that rendering in that backend occurs per-component using the renderTo function. Since ComponentGraphics doesn't implement Component, the implementation can't access that directly.
If I were to try to create a non-dummy ComponentGraphicsImpl, would the most idiomatic way be to:
- create a custom subclass of Component, like ComponentGraphicsRenderer, defined private to ComponentGraphicsImpl.hx
- on instantiation of ComponentGraphicsImpl, create a ComponentGraphicsRenderer with reference to the ComponentGraphics object, and add as a child of the Component
- override the renderTo functions in ComponentGraphicsRenderer to execute the draw commands in ComponentGraphics
I'm wary about modifying the Component tree upon instantiation of the ComponentGraphics object since it seems like various systems depend on consistent order and type of child components. The only other way I can think to do it would be to modify ComponentImpl to allow delegation in renderTo, but that seems like a deeper and gnarlier change.bright-gpu-74537
01/08/2023, 6:14 PMbright-gpu-74537
01/08/2023, 6:15 PMbright-gpu-74537
01/08/2023, 6:15 PMbright-gpu-74537
01/08/2023, 6:16 PMfew-pizza-8232
01/08/2023, 6:16 PMfew-pizza-8232
01/08/2023, 6:17 PMrenderCustom is meeting my current needs. but if I do I'll submit a PRfew-pizza-8232
01/08/2023, 6:17 PMbright-gpu-74537
01/08/2023, 6:18 PMbright-gpu-74537
01/08/2023, 9:32 PMfull-journalist-82607
01/08/2023, 9:41 PMfull-journalist-82607
01/08/2023, 9:43 PMbright-gpu-74537
01/08/2023, 9:45 PMbright-gpu-74537
01/08/2023, 9:46 PMfull-journalist-82607
01/08/2023, 9:52 PMbright-gpu-74537
01/08/2023, 9:53 PMfull-journalist-82607
01/08/2023, 9:59 PMbright-gpu-74537
01/08/2023, 10:00 PMbright-gpu-74537
01/08/2023, 10:00 PM