From: Arjan v. I. <af...@cs...> - 2005-05-13 21:16:07
|
> How can I create anonymous widgets (i.e., do not assign them)? > > For instance think of a row of buttons labeled as '1' to '0' and > activating the same callback with the Integers '1' to '0' respectivly. It could go something like this: (untested code) main = start $ do f <- frame [ text := "Window with many buttons" ] buttons <- sequence [ button f [ text := show i, on command := doSomething i ] | i <- [0..9] ] set f [ layout := fill (row 5 (map widget buttons)) ] doSomething nr = do putStrLn "button " ++ show nr ++ "has been pressed Cheers, Arjan |