Я хотел бы получить значение виджета.
Далее, нажав кнопку b, извлеките s_in и распечатайте его в родном wxhaskell.
b <- button f [text:= "print text in console",
on command := textCtrlGetValue s_in >>= putStrLn]
Мне нравится делать то же самое с reactive-banana , но в дальнейшем я получаю «ff», а не textCtrlGetValue s_in2.
s_in <- textCtrl f []
s_in2 <- textCtrl f []
b <- button f [text:= "print text in console",
on command := textCtrlGetValue s_in >>= putStrLn]
let networkDescription :: forall t. Frameworks t => Moment t ()
networkDescription = do
b_in <- behaviorText s_in "init"
b_in2 <- behaviorText s_in2 "ff"
e_butt <- event0 b command
-- I need an event, triggered by the button, and filled by the b_in2,
sink s_in2 [text :== id <$> b_in]
reactimate $ (\x -> putStrLn x) <$> b_in2 <@ e_butt
сток хорошо обновляет sin_2 после s_in . но следующая строка реакции не дает мне textCtrlGetValue s_in/b_in, который я хочу получить. как я могу "получить" его?