Make a Line the Focused element #332
-
I am working on a problem where I need to create a Line.create [
Line.startPoint (location * state.Zoom + state.WindowPosition)
Line.endPoint state.PointerPosition
Line.focusable true // Here I make the Line something I can focus on
Line.stroke Dims.Line.color
Line.strokeThickness 2.0
Line.onKeyDown (fun e ->
e.Handled <- true
if e.Key = Key.Escape then
Msg.Escape |> dispatch)
] I also tried to create the line and then set a let line = Line.create [
Line.startPoint (location * state.Zoom + state.WindowPosition)
Line.endPoint state.PointerPosition
Line.focusable true
Line.stroke Dims.Line.color
Line.strokeThickness 2.0
Line.onKeyDown (fun e ->
e.Handled <- true
if e.Key = Key.Escape then
Msg.Escape |> dispatch)
]
line.Focused <- true // This doesn't exist but it was my first thought
line I'm also open to adding the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
IIRC not all controls can be in focus, they need to be I would build my own way of knowing which line/box is selected. |
Beta Was this translation helpful? Give feedback.
IIRC not all controls can be in focus, they need to be
IInputElements
.I would build my own way of knowing which line/box is selected.