Commit 414cd64f authored by David Davó's avatar David Davó

Added widget list notebook

parent 3cca0604
This diff is collapsed.
...@@ -50,4 +50,36 @@ First you have to check if the attribute is only for one widget, or is from a co ...@@ -50,4 +50,36 @@ First you have to check if the attribute is only for one widget, or is from a co
> Some widgets receive messages from the frontend when a value is modified (such as sliders, text areas, buttons...). You'll have to modify the `comm` function instantiated from the class `IHaskellWidget`. You can find an example at [IntSlider.hs](./Int/BoundedInt/IntSlider.hs) > Some widgets receive messages from the frontend when a value is modified (such as sliders, text areas, buttons...). You'll have to modify the `comm` function instantiated from the class `IHaskellWidget`. You can find an example at [IntSlider.hs](./Int/BoundedInt/IntSlider.hs)
## FAQ ## FAQ
When using widgets in ihaskell, you'll encounter a lot of compilation errors. If you are not very familiar with Haskell, they can be a bit hard to decipher, this is a mini guide that will (hopefully) appear when you paste the error in Google. When using widgets in ihaskell, you'll encounter a lot of compilation errors. If you are not very familiar with Haskell, they can be a bit hard to decipher, this is a mini guide that will (hopefully) appear when you paste the error in Google.
\ No newline at end of file
### setField: No instance for...
You probably got this error when trying to use setField like this:
```
<interactive>:1:1: error:
• No instance for (Data.Vinyl.Lens.RecElem
Data.Vinyl.Core.Rec
'ihaskell-widgets-0.3.0.0:IHaskell.Display.Widgets.Singletons.Index
'ihaskell-widgets-0.3.0.0:IHaskell.Display.Widgets.Singletons.Index
'[]
'[]
(Data.Vinyl.TypeLevel.RIndex 'ihaskell-widgets-0.3.0.0:IHaskell.Display.Widgets.Singletons.Index '[]))
arising from a use of ‘setField’
• In the expression: setField select Index 0
In an equation for ‘it’: it = setField select Index 0
```
What this error means is that there is no field called `Index` for this particular widget. You can display on screen all
the fields available for a widget using `properties widget`.
### setField: Couldn't match expected type SField f with actual type
If you get an error like this, you probably forgot to put the field name in the second argument of `setField`.
```
<interactive>:1:25: error:
• Couldn't match expected type ‘ihaskell-widgets-0.3.0.0:IHaskell.Display.Widgets.Singletons.SField f’ with actual type ‘[a0]’
• In the second argument of ‘setField’, namely ‘["Apples", "Oranges", "Pears"]’
In the expression: setField selectMultiple ["Apples", "Oranges", "Pears"]
In an equation for ‘it’: it = setField selectMultiple ["Apples", "Oranges", "Pears"]
• Relevant bindings include it :: ihaskell-widgets-0.3.0.0:IHaskell.Display.Widgets.Types.FieldType f -> IO () (bound at <interactive>:1:1)
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment