For the detailed examples, see Tron.Build
, it contains the same functions and types (most of them here are just functions from Tron.Build.Any
where a
is omitted since it's just ()
in this case).
The difference is that Tron msg
is the Tree (Control.Value -> Maybe msg)
and so it produces messages in response to anything, but Tree ()
just
describes the structure of the components, storing nothing sensitive inside.
To map over and manipulate such trees in different ways, use Tron.Tree
module. For example,
using Tree.proxify
, the Tree ()
may be filled with current values and you would get Tree Control.Value
.
Use this builder to define interfaces which don't produce any messages (to free yourself from specifying ()
value for every control) and then using Tron.lift
any Tree ()
may be lifted to Tron ()
(i.e. Tree (Control.Value -> Maybe ())
), so that it would fit the for
function required for WithTron
specifications.
You also get Tree ()
as the storage for previous values in for
, update
and view
from WithTron
definitions.
Tron.Tree.Tree ()
The alias to the unit Tree: Tron.Tree.Tree ()
.
List ( Label
, Tree
}
toSet : (a -> Label) -> List (Tron.Tree.Tree a) -> Tron.Tree.Build.Any.Set a
root : Set -> Tree
none : Tree
int : { min : Basics.Int, max : Basics.Int, step : Basics.Int } -> Basics.Int -> Tree
float : Axis -> Basics.Float -> Tree
number : Axis -> Basics.Float -> Tree
xy : ( Axis, Axis ) -> ( Basics.Float, Basics.Float ) -> Tree
coord : ( Axis, Axis ) -> ( Basics.Float, Basics.Float ) -> Tree
color : Color -> Tree
text : String -> Tree
input : (x -> String) -> x -> Tree
button : Tree
buttonWith : Face -> Tree
toggle : Basics.Bool -> Tree
bool : Basics.Bool -> Tree
nest : Set -> Tree
choice : Tron.Tree.Build.Any.Set comparable -> comparable -> Tree
choiceBy : Tron.Tree.Build.Any.Set a -> a -> (a -> a -> Basics.Bool) -> Tree
strings : List String -> String -> Tree
labels : (a -> Label) -> List a -> a -> Tree
palette : List ( Label, Color ) -> Color -> Tree
buttons : List a -> List (Tron.Tree.Tree a)
useColor : Color -> Face
face : Face -> Tron.Tree.Tree a -> Tron.Tree.Tree a
Tron.Control.Impl.Button.Face
Tron.Control.Impl.Button.Icon
icon : Url -> Face
iconAt : List String -> Face
themedIcon : (Tron.Style.Theme.Theme -> Maybe Url) -> Face
themedIconAt : (Tron.Style.Theme.Theme -> List String) -> Face
expand : Tree -> Tree
collapse : Tree -> Tree
shape : Tron.Style.PanelShape.PanelShape -> Tree -> Tree
Changes panel shape for nest
and choice
panels:
Build.nest ... |> Buidler.shape (cols 2)
Build.choice ... |> Buidler.shape (rows 1)
Build.choice ... |> Buidler.shape (by 2 3)
cells : Tron.Style.CellShape.CellShape -> Tree -> Tree
Changes cell shape for nest
and choice
panels:
Build.nest ... |> Buidler.cells single
Build.choice ... |> Buidler.shape halfByTwo
Build.choice ... |> Buidler.shape halfByHalf
Usually in your for
function you set the default value to the control, but if you change the control with live
, then you'll be able to pass some dynamic value from your model to it.
live : Tree -> Tree
toChoice : Tree -> Tree
toKnob : Tree -> Tree
Convert choice control to a switch by click form:
Build.choice ... |> Build.toSwitch
toSwitch : Tree -> Tree
Convert choice control to a switch by click form:
Build.choice ... |> Build.toSwitch