Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
deprecate DelayedInit outside of App #5479
I know that this is against Scala's spirit but let's face it: App is a very small feature that is mostly important to people learning and teaching Scala. Let's just deliver this feature in the most useful way to Scala users and move on to more important issues.
Just to be clear, I understand why
However, in ScalaFX, the
It seems that there are no plans for a replacement feature that works better. I've seen the proposal to use an
I think the most obvious solution is to split JFXApp into two classes, one that creates the application and initializes JavaFX, and another (executed on the JavaFX application thread) that is a base class for defining the GUI and its interactions. However, it's not clear to me how we could make this compatible with existing code.
Does anyone have any suggestions for an elegant
@MichaelJAllen, I don't have experience with ScalaFX, but in our experience in Dotty we were able to convert all the usages of DelayedInit into constructor arguments.
In the example that you've referred to, could you make
The main difference would be that it will not introduce duplicated members & scopes automagically.
@DarkDimius Thanks for your suggestion! It was the removal of support for
I think I see what you're getting at. You pass a function containing the GUI configuration during initialialization to
I guess I'll need to think about this some more and try it out, but if I have your concept right, this would break existing code in a number of ways, and it seems that the scoping would complicate matters a lot too.