Open shawnye opened 6 years ago
The project is in a very early stage. It first needs more developers and then decisions how to go forward. I think before implementing more controls, the general concept should be finished and documented. If there is any interested developer (especially on macOS), please contact me.
Dankr4d is working on these: https://github.com/Dankr4d/nigui/tree/widgets
@enthus1ast thank you! I will try it
Is checkbox usable on Windows since nim v1.0? found NativeCheckbox* = ref object of Checkbox seems incomplete. What to do if I try to finish this?
I have implemented checkboxes here recently, no known issues. Yes, NiGui works with Nim 1.0. Other widgets will follow at some time.
Great, probably
var checkbox = newCheckbox("Checkbox")
checkbox.init()
checkbox.text = "Checkbox"
container.add(checkbox)
helps to see how checkbox works in exmpale_02_controls.nim
@cn-care: example_02_controls.nim already contains a checkbox.
In your code example, you should not call init()
, because it's called automatically in newCheckbox()
.
May be add this to the example_02_controls.nim
# Add a further Checkbox control:
var checkbox2 = newCheckbox("Checkbox2")
container.add(checkbox2)
# Add toggle event to the checkbox
checkbox.onToggle = proc(event: ToggleEvent) =
case checkbox.checked
of true: textArea.addLine("Checkbox was checked")
of false: textArea.addLine("Checkbox was unchecked")
# Add toggle event to the checkbox2 to enable/disable checkbox
checkbox2.onToggle = proc(event: ToggleEvent) =
case checkbox.enabled
of true:
checkbox.enabled = false
textArea.addLine("Checkbox was disabled")
of false:
checkbox.enabled = true
textArea.addLine("Checkbox was enabled")
Thank you for nice work! That's what I want.
How to use controls such as select list,checkbox,radio?
BTW, how to add address bar when open dialog?
Thank you!