edvin
05/27/2017, 8:27 AMedvin
05/27/2017, 9:40 AMedvin
05/27/2017, 9:40 AMedvin
05/27/2017, 9:43 AMedvin
05/27/2017, 9:46 AMedvin
05/27/2017, 10:16 AMalexp11223
05/27/2017, 10:24 AMedvin
05/27/2017, 10:29 AMcarlw
05/27/2017, 11:34 AMedvin
05/27/2017, 11:45 AMshortcut
function that will make them global within the Stage.alexp11223
05/27/2017, 11:51 AMbutton("", imageview("save.png")) {
shortcut("Shortcut+S")
tooltip("Save ($shortcutText)")
}
alexp11223
05/27/2017, 11:59 AMaccelerators
is global
val UIComponent.shortcutText: String
get() = accelerators.keys.firstOrNull()?.displayText ?: ""
carlw
05/27/2017, 12:08 PMcarlw
05/27/2017, 12:10 PMcarlw
05/27/2017, 12:10 PMalexp11223
05/27/2017, 12:12 PMcarlw
05/27/2017, 12:12 PMcarlw
05/27/2017, 12:17 PMcarlw
05/27/2017, 12:17 PMcarlw
05/27/2017, 12:18 PMedvin
05/27/2017, 12:58 PMcompute()
instead. Or am I missing something?edvin
05/27/2017, 12:58 PMcarlw
05/27/2017, 12:58 PMedvin
05/27/2017, 12:59 PMcarlw
05/27/2017, 12:59 PMedvin
05/27/2017, 1:00 PMcommand = commands.computeCommand
instead of action { commands.computeCommand.execute() }
?carlw
05/27/2017, 1:01 PMedvin
05/27/2017, 1:03 PMedvin
05/27/2017, 1:03 PMcommand = commands.computeCommand with param
edvin
05/27/2017, 1:04 PMparam
can even be an ObservableValue. In that case, the value of the observable would be extracted at execution time and passed to the action.