bright-gpu-74537
06/28/2022, 6:41 AMbright-gpu-74537
06/28/2022, 6:48 AMbright-gpu-74537
06/28/2022, 6:48 AMhaxe
@:bind(tf1.text) var theText:String = "bob";
@:bind(tf1.disabled) var theDisabled:Bool = true;
@:bind(btn1.text) var theText2:String = "tim";
@:bind(btn1.disabled) var theDisabled2:Bool = true;bright-gpu-74537
06/28/2022, 6:48 AMhaxe
@:bind(check, MouseEvent.CLICK)
private function oncheck(e) {
theText = "" + Std.random(1000);
theDisabled = Std.random(2) == 1;
theText2 = "" + Std.random(1000);
theDisabled2 = Std.random(2) == 1;
}full-journalist-82607
06/28/2022, 7:59 AMhallowed-ocean-84954
06/28/2022, 1:03 PM.../tools/metaballeditor/metaballeditor/.haxelib/haxeui-core/git/haxe/ui/macros/ComponentMacros.hx:784: characters 40-117 : On static platforms, null can't be used as basic type Bool
.../tools/metaballeditor/metaballeditor/.haxelib/haxeui-core/git/haxe/ui/macros/ComponentMacros.hx:784: characters 40-117 : On static platforms, null can't be used as basic type Boolhallowed-ocean-84954
06/28/2022, 1:04 PMhallowed-ocean-84954
06/28/2022, 1:05 PM@:bind(saveDefinitionButton.disabled)
var _saveRequired:Bool = true;bright-gpu-74537
06/28/2022, 1:12 PMbright-gpu-74537
06/28/2022, 2:53 PMbright-gpu-74537
06/28/2022, 2:54 PMhallowed-ocean-84954
06/28/2022, 2:55 PMbright-gpu-74537
06/28/2022, 2:56 PMhallowed-ocean-84954
06/28/2022, 2:57 PMhallowed-ocean-84954
06/29/2022, 12:22 AMdisabled="" on the button expecting that the default value on the MainView.hx variable would be enough ... or something. So I had this:
<button id="saveDefinitionButton" text="Save Definition" style="color: blue;" disabled="" styleName="button-text"/>
Removing the disabled="" fixed it.hallowed-ocean-84954
06/29/2022, 12:24 AMhallowed-ocean-84954
06/29/2022, 12:26 AMhallowed-ocean-84954
06/29/2022, 1:04 AMhallowed-ocean-84954
06/29/2022, 3:33 AMsource/MainView.hx:102: json={"x":256,"y":256,"falloffFunctions":[["a","=","(1-r)^4","r","0.0","1.0"],["a","=","0.0","r","1.0","234234"]],"xyTransform":["r","=","x^4+y^4"]}
Uncaught exception: Can't cast bytes to String
Called from lime.ui.FileDialog.~browse.2(lime/ui/FileDialog.hx:80)
Called from lime.app._Event_Dynamic_Void.dispatch(lime/_internal/macros/EventMacro.hx:91)
Called from lime.system.BackgroundWorker.sendComplete(lime/system/BackgroundWorker.hx:82)
Called from lime.ui.FileDialog.~browse.1(lime/ui/FileDialog.hx:71)
Called from lime.app._Event_Dynamic_Void.dispatch(lime/_internal/macros/EventMacro.hx:91)
Called from lime.system.BackgroundWorker.__doWork(lime/system/BackgroundWorker.hx:115)
Called from lime.system.BackgroundWorker.run(lime/system/BackgroundWorker.hx:67)
Called from lime.ui.FileDialog.browse(lime/ui/FileDialog.hx:111)
Called from openfl.net.FileReference.save(openfl/net/FileReference.hx:1045)
Called from haxe.ui.backend.SaveFileDialogImpl.show(...\tools\metaballeditor\metaballeditor\.haxelib\haxeui-flixel\git\haxe\ui\backend\SaveFileDialogImpl.hx:51)
Called from MainView.onSaveDef(MainView.hx:120)
I'm putting a JSON string from haxe.Json.stringify in so I'm assuming the byte cast is from something else.
My save code is verbatim the "long method" in the example for text save except that I have a different text string source and one debug statement. It appears that the result from the worker is expected to be a string but it's bytes in this case.best-agent-85158
06/29/2022, 7:19 AMbest-agent-85158
06/29/2022, 7:19 AMbright-gpu-74537
06/29/2022, 7:29 AMbright-gpu-74537
06/29/2022, 7:46 AMdisabled="" should end up as false imobright-gpu-74537
06/29/2022, 7:48 AMObservable<T> or anything like that in haxeuibright-gpu-74537
06/29/2022, 9:33 AMbright-gpu-74537
06/29/2022, 9:35 AMbright-gpu-74537
06/29/2022, 9:46 AMopenfl/net/FileReference.hx:1045 is if (data == null) return; which doesnt seem to make alot of sense - what version of openfl are you on? But saving works fine for mebright-gpu-74537
06/29/2022, 9:46 AMhaxe
saveFileButton.onClick = function(_) {
var dialog = new SaveFileDialog();
dialog.options = {
title: "Save Text File",
writeAsBinary: false,
extensions: FileDialogTypes.TEXTS
}
dialog.onDialogClosed = function(event) {
if (event.button == DialogButton.OK) {
Dialogs.messageBox("File saved!", "Save Result", MessageBoxType.TYPE_INFO);
}
}
dialog.fileInfo = {
name: "My Text File.txt",
text: Json.stringify("{}")
}
dialog.show();
}best-agent-85158
06/29/2022, 10:22 AMbest-agent-85158
06/29/2022, 10:22 AM