Ruckus
08/23/2017, 4:15 PMby
is a "soft keyword" (http://kotlinlang.org/docs/reference/keyword-reference.html#soft-keywords).
The following tokens act as keywords in the context when they are applicable and can be used as identifiers in other contextsWhen we were discussing it earlier, we thought it would be best avoided for the Point2D infix as it might be confusing next to actual delegate calls, though it would compile without a problem.
val controller: MyController by inject()
val position: Point2D = 2 by 4
It technically works fine, and can even be understood fairly easily for most, but may be a bit confusing to new users.Ruckus
08/23/2017, 4:17 PMRuckus
08/23/2017, 4:20 PMcarlw
08/23/2017, 5:51 PMcarlw
08/23/2017, 8:12 PMnimakro
08/23/2017, 8:18 PMdevanand
08/23/2017, 8:23 PMdevanand
08/23/2017, 8:24 PMclass MainView : View() {
override val root = gridpane()
val iv : IconView by di("iconView")
val mv : MenuView by di("menuView")
val tv : TabbedView by di("tabView")
val sv : ShortcutView by di("shortcutView")
init {
with(root) {
row{
iv{
//some gridpane constraints
}
}
}
}
}
edvin
08/23/2017, 9:41 PMedvin
08/23/2017, 9:43 PMedvin
08/23/2017, 9:44 PMdevanand
08/23/2017, 9:45 PMMarcin Wisniowski
08/23/2017, 10:25 PMjchildress
08/24/2017, 2:39 AMjchildress
08/24/2017, 2:39 AMedvin
08/24/2017, 6:13 AMadd(MyView::class)
. No need to inject them at the top of your class. Your could above doesn't compile I suspect, as iv
is just a view, not a builder function. You could do add(iv)
to add that instance of the view as well, but normally there is no need to inject it first and then add it.aayush
08/24/2017, 10:55 AMclass TabbedView : View() {
var tabs : TabPane by singleAssign()
override val root = hbox()
init {
with(root) {
tabs = tabpane {
}
}
}
}
This is my tabview and i want to add tabs from a button click from another view ?
I saw this in javafx ( https://community.oracle.com/thread/2535484 ) but cannot get how to do it in tornado?edvin
08/24/2017, 11:00 AMtabbedView.tabs.add(SomeFragmentYouWantToAdd::class)
.edvin
08/24/2017, 11:01 AMTabbedView
so that you can internalize the actual addition process.aayush
08/24/2017, 11:03 AMedvin
08/24/2017, 11:05 AMaayush
08/24/2017, 11:05 AMedvin
08/24/2017, 11:08 AMaayush
08/24/2017, 11:08 AMaayush
08/24/2017, 11:30 AMclass TabbedView : View() {
var tabs: TabPane by singleAssign()
override val root = hbox()
init {
with(root) {
tabs = tabpane()
}
addTabs("Tab1",SampleTabView::class)
}
fun addTabs(title: String , view: View) {
tabs.tab(title, view::class)
// tabs.add(SampleTabView::class)
}
}
class SampleTabView : View() {
override val root = vbox {
button("Button 1")
button("Button 2")
}
}
aayush
08/24/2017, 11:32 AMedvin
08/24/2017, 11:40 AMedvin
08/24/2017, 11:40 AMimage.png▾
edvin
08/24/2017, 11:40 AM