GUI component interaction: Difference between revisions
m
→{{header|Haskell}}: made use of wxHaskell's 'when' function
(→{{header|Haskell}}: added Haskell solution) |
m (→{{header|Haskell}}: made use of wxHaskell's 'when' function) |
||
Line 625:
ran <- button frm [text := "random", on command := (randReplace fld frm)]
set frm [layout := margin 5 $ floatCentre $ column 2
[centre $ widget fld, row 2 [widget inc, widget ran]]]
increment :: Textual w => w -> IO ()
increment field = do
val <- get field text
then set field [text := show $ 1 + read val]▼
checkKeys :: EventKey -> IO ()
Line 642 ⟶ 640:
randReplace field frame = do
answer <- confirmDialog frame "Random" "Generate a random number?" True
▲ then getStdRandom (randomR (1,100)) >>= \num ->
==Icon and {{header|Unicon}}==
|