Monadic-ScalaFX-Demo/src/main/scala/nova/monadic_sfx/ui/screens/Screen.scala

14 lines
341 B
Scala
Raw Normal View History

package nova.monadic_sfx.ui.screens
import monix.eval.Task
import scalafx.application.JFXApp.PrimaryStage
import scalafx.scene.Parent
trait Screen {
protected def appStage: PrimaryStage
def changeRoot(root: Parent): Unit = {
appStage.scene().setRoot(root)
}
def changeRootL(root: Parent): Task[Unit] = Task(changeRoot(root))
}