https://kotlinlang.org logo
#tornadofx
Title
# tornadofx
t

Tim McCormack

12/08/2019, 2:17 PM
Hmm,
confirm
suffers the same problem as creating a JavaFX dialog directly: The text gets cut off and you can't even resize the alert window to see the truncated message.
a

altavir

12/08/2019, 2:38 PM
As far as I rememver, there are a lot of different handles on alerts. You can use your own raw builder for it, not necessary use tornado shortcuts.
t

Tim McCormack

12/08/2019, 2:44 PM
Found the dialogPane.content workaround:
Copy code
val delete = ButtonType("Delete post and attachments", ButtonBar.ButtonData.APPLY)
val cancel = ButtonType("Cancel", <http://ButtonBar.ButtonData.NO|ButtonBar.ButtonData.NO>)
val prompt = Dialog<ButtonType?>().apply {
    title = "Delete post"
    headerText = "Delete this post?"
    dialogPane.content = Text("The entire post and all of its attachments will be deleted irrevocably.").apply {
        wrappingWidth = 600.0
    }
    dialogPane.buttonTypes.setAll(delete, cancel)
}
with
Text
and
wrappingWidth
3 Views