https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    08/15/2022, 7:44 PM
    now, im guessing that,
    lime.app.Application.current.window.onMouseDown.dispatch
    for all intents and purposes is basically just calling a callback function
  • l

    loud-salesclerk-7438

    08/15/2022, 7:45 PM
    now the question is how to get those events executed by main thread...
  • b

    bright-gpu-74537

    08/15/2022, 7:45 PM
    and thats coming from another thread
  • b

    bright-gpu-74537

    08/15/2022, 7:45 PM
    i would use a queue, and check that with a timer or something
  • b

    bright-gpu-74537

    08/15/2022, 7:46 PM
    im not really surprised that:
    Copy code
    haxe
                sys.thread.Thread.create(function() {
                    Sys.sleep(ms / 1000);
                    lime.app.Application.current.window.onMouseDown.dispatch(57, 18.5, lime.ui.MouseButton.LEFT);
                });
    causes issues, i am a little surprised that the issue is a sync validation loop however, i would expected something more... unexpected, like a seg fault, or something
  • b

    bright-gpu-74537

    08/15/2022, 7:47 PM
    so thats certainly something worth checking out
  • l

    loud-salesclerk-7438

    08/15/2022, 7:48 PM
    I assume setting properties might also scuff out, especially if it's one that does more than just set a variable... I guess I'll have to figure out a way to run these things in main thread
  • b

    bright-gpu-74537

    08/15/2022, 7:50 PM
    yeah, i mean, you almost certainly want to run these things on the main thread - for sure - but im still a little dubious that haxeui isnt also doing something wrong here, i really wouldnt have expected such a reproducible error with this... maybe im wrong
  • b

    bright-gpu-74537

    08/15/2022, 7:53 PM
    oh, but hang on, yeah, maybe that all makes sense... i mean, assuming
    onMouseDown.dispatch
    is basically calling "just a function" (which im guessing it is) then it means that the dropdown itself is being created, essentially, on another thread
  • l

    loud-salesclerk-7438

    08/15/2022, 7:56 PM
    yeah it sometimes works and sometimes it doesn't, probably depending on what main thread is doing at the time.
  • b

    bright-gpu-74537

    08/15/2022, 7:57 PM
    yeah, i think it makes sense... i mean, in the sense that it breaks...
  • b

    bright-gpu-74537

    08/15/2022, 7:58 PM
    openfl (and therefore haxeui-openfl) is fundementally single threaded (im guessing most, of not all, haxeui backends are)
  • l

    loud-salesclerk-7438

    08/15/2022, 7:58 PM
    it also explains why it never breaks in html5 builds
  • b

    bright-gpu-74537

    08/15/2022, 7:59 PM
    so i think your best bet is to have all your threaded stuff doing its messaging, but that is pushed to a queue, which runs off of a timer, or something, (maybe a Toolkit.callLater?), checks for messages in there and then does its stuff there on the main thread
  • l

    loud-salesclerk-7438

    08/15/2022, 8:03 PM
    yeah, I guess I'll have to go for something like that. maybe that will also fix the other more obscure C++ error message
  • b

    bright-gpu-74537

    08/15/2022, 8:03 PM
    possibly, but yeah, i think a poll and dispatch type pattern is the only really good option here
  • l

    loud-salesclerk-7438

    08/16/2022, 10:02 AM
    after a little bit of refactoring and running my test cases multiple times it seems like delegating events and property setting to main thread makes for a more stable testing experience. I haven't seen any failures or crashes so far. I guess that's solved for now! 🎉
  • n

    nutritious-australia-67366

    08/16/2022, 4:13 PM
    Hi, Playing around with HaxeUI+OpenFl Backend. I'm trying to bring a 'select file/folder' dialog, but I'm not really having success. I'm following the example on the component explorer(http://haxeui.org/explorer/), but the code from there, doesn't compile - is it up to date?
  • b

    bright-gpu-74537

    08/16/2022, 4:38 PM
    yeah, the explorer is very up to date, its probably more likely that you are using haxelib version? (which is super out of date)
  • b

    bright-gpu-74537

    08/16/2022, 4:39 PM
    you'll probably want to do something like:
    Copy code
    haxelib git haxeui-core https://github.com/haxeui/haxeui-core
    haxelib git haxeui-openfl https://github.com/haxeui/haxeui-openfl
  • n

    nutritious-australia-67366

    08/16/2022, 5:29 PM
    Ahaaa, you are right, thanks for protip - will try asap.
  • n

    nutritious-australia-67366

    08/16/2022, 5:45 PM
    Unfortunately that introduced other problems: when creating a new a with haxelib run haxeui-core create openfl, I get the error when compiling:
  • n

    nutritious-australia-67366

    08/16/2022, 5:46 PM
    C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:271: characters 40-59 : haxe.ui.styles.Style has no field backgroundPositionX C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:271: characters 67-86 : haxe.ui.styles.Style has no field backgroundPositionY C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:275: characters 40-59 : haxe.ui.styles.Style has no field backgroundPositionX C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:275: characters 67-86 : haxe.ui.styles.Style has no field backgroundPositionY C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:282: characters 40-59 : haxe.ui.styles.Style has no field backgroundPositionX C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:282: characters 67-86 : haxe.ui.styles.Style has no field backgroundPositionY C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:297: characters 36-55 : haxe.ui.styles.Style has no field backgroundPositionX C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:298: characters 35-54 : haxe.ui.styles.Style has no field backgroundPositionY C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:313: characters 36-55 : haxe.ui.styles.Style has no field backgroundPositionX C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/openfl/OpenFLStyleHelper.hx:314: characters 36-55 : haxe.ui.styles.Style has no field backgroundPositionY C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/TextInputImpl.hx:85: lines 85-87 : Field get_caretIndex is declared 'override' but doesn't override any field C:/HaxeToolkit/haxe/lib/haxeui-openfl/git/haxe/ui/backend/TextInputImpl.hx:88: lines 88-91 : Field set_caretIndex is declared 'override' but doesn't override any field
  • e

    elegant-twilight-61392

    08/16/2022, 5:51 PM
    did you make sure to update both to
    git
    ?
  • e

    elegant-twilight-61392

    08/16/2022, 5:51 PM
    not just one or the other
  • n

    nutritious-australia-67366

    08/16/2022, 5:53 PM
    Whooops, yes I did, but somehow my haxelib list command shows:
  • n

    nutritious-australia-67366

    08/16/2022, 5:53 PM
    haxeui-core: [1.4.0] git haxeui-openfl: 1.4.0 [git]
  • n

    nutritious-australia-67366

    08/16/2022, 5:53 PM
    Will, try again
  • n

    nutritious-australia-67366

    08/16/2022, 5:57 PM
    That did the trick! Thanks again
  • n

    nutritious-australia-67366

    08/16/2022, 6:00 PM
    Next question: Is it possible to select a folder in the dialog instead of a file?
1...121112121213...1687Latest