Did you get it all working now for Lime? Can you use it from the Window class cleanly?
I think it would be best to probably hack it in if you want it for legacy. There’s a Frame/Stage system that would require you to make additions in multiple stages (iOS/Android/etc) which could be complex. For now, perhaps you should add a function in https://github.com/openfl/lime/blob/master/legacy/project/src/ExternalInterface.cpp with your functionality.
Yep it’s working, right now I have to use it like this:
Lib.application.window.alert(5, 0);
I will try the legacy part when I get home
So if I added the method in ExternalInterface.cpp with the same arguments and such, will it be usable right away without even changing the stuffs at the .hx end?
Similar to what you did already with Lime, you will need something on the Haxe side with Lib.load (legacy) or System.load (current OpenFL/Lime)
The Lime API is not available in Lime legacy, so you won’t be able to use the Window class. One way to do it would be to handle it conditionally in your project:
#if !lime_legacy
stage.window.alert (5, 0);
#elseif windows
var lime_window_alert = Lib.load ("lime", "lime_window_alert", 2);
lime_window_alert (5, 0);
#end
Thanks for the API doc. The legacy version of alert method is now perfectly functional.
What I meant was, can I add a method in openfl.display.Stage for both legacy and lime 2? and in lime 2 I will use window.alert and in legacy I will use the external interface call. If the target is not windows, the function will be empty. I just need a permission to edit that class because I kinda feel like it’s important lol
I would be a bit less bothered if there was a function added to openfl._legacy.display.Stage, since it won’t show in code completion, but I want to make sure that the primary Stage class remains clean
For a moment, I was debating whether to call it “alert” (actually) because of confusion with popup boxes. After considering whether this should pair with more general notification support (with or without the popup dialog) or an alert box, I settled on the alert.
I believe this is meant to be immediate, where notifications may be scheduled for when you are not running.
We might decide to make this better or a little different, but for now I’ve added support for window.alert (type, title, message) if these left null, it will blink the taskbar on Windows while the application is minimized, but if they are not, then it shows an OS popup message box
We can add support for OS X bouncing in the dock, or a flash on different X window systems, I think
I was trying to understand the case for controlling the speed or count. Why would it make sense to do something other than the OS default, or to flash only a certain number of times instead of until the user opens the application?