File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -231,11 +231,11 @@ radiobuttons(T::WidgetTheme, vals; kwargs...) =
231
231
"""
232
232
```
233
233
checkboxes(options::AbstractDict;
234
- value = first(values( options)))
234
+ value = valtype( options)[]
235
235
```
236
236
237
237
A list of checkboxes whose item labels are the keys of options.
238
- Tthe observable will hold an array containing the values
238
+ The observable will hold an array containing the values
239
239
of all selected items,
240
240
e.g. `checkboxes(OrderedDict("good"=>1, "better"=>2, "amazing"=>9001))`
241
241
@@ -264,6 +264,17 @@ Note that the `options` can be modified from the widget directly:
264
264
```julia
265
265
wdg[:options][] = ["c", "d", "e"]
266
266
```
267
+
268
+ To create checkboxes that are already checked off when shown, one can use the `value` keyword:
269
+
270
+ ```julia
271
+ options = ["a", "b", "c"]
272
+ value = ["a", "c"]
273
+ checkboxes(options, value = value)
274
+ ```
275
+
276
+ The boxes "a" and "c" will be checked off when the checkboxes widget is shown.
277
+ Both `options` and `value` can be Observables.
267
278
"""
268
279
checkboxes (T:: WidgetTheme , options; kwargs... ) =
269
280
Widget {:checkboxes} (multiselect (T, options; typ= " checkbox" , kwargs... ))
You can’t perform that action at this time.
0 commit comments