-
Notifications
You must be signed in to change notification settings - Fork 271
Add value property to radiomenuitem #737
Comments
Can you explain what you're trying to do? |
Here is a small example View with two buttons inside a toggle group, and a listener on the selected value of the group: class MyView : View() {
override val root = hbox {
togglegroup {
togglebutton("One", value = 1)
togglebutton("Two", value = 2)
selectedValueProperty<Int>().onChange {
println("Value is $it")
}
}
}
} |
If I understand correctly, you need a way to assign a value to a checkbox menu item, like you can do for the togglebutton, right? I'll implement this later today :) |
Correct, need to be able to set Everything else look OK in this code? There arent any good examples of using radiomenuitems or togglegroups in menus that I can find online. Thanks for the help! |
Yeah, the rest looks good - you've grasped the essence of the framework nicely :)) Will get back to you later today. |
PS: In this particular case you probably don't gain anything from wrapping the |
Thanks for the tip. There isnt a lot of guidance on that subject of when to use a ViewModel and when to just have a property in the View. It seems ViewModels are more appropriate for forms that need to have data in a working state before being committed. In my specific case I already have a property in DesktopApp so I just bound to that instead. |
Since I have you... ;) What is the best way to reload the app with the new locale set? I was just going to go old school and restart the app. Is there a better way? |
Sorry for not getting back to you yesterday, stuff happened :) Trying again today. |
I've added the |
There isn't an easy way to reload the app when the locale changes. Any text retrieved from the resource bundles are already statically set. We could fix this by exposing observable properties for the resource bundle lookups, but I don't think it's worth it. |
@edvin I think there is an issue(s) with the implementation of this. Either that or Im not understanding how this is supposed to work. Sadly, Im just now getting back to this code.
My re-implementation of Please advice on if this is a bug or my misunderstanding.
|
You're right, sorry about that. I've committed a fix now. |
Need to be able to set
properties["tornadofx.toggleGroupValue"]
so can bind toToggleGroup SelectedValue
.The text was updated successfully, but these errors were encountered: