From: James M. <ji...@ya...> - 2005-05-11 05:33:52
|
Hi y'all, In order to better learn Haskell, I've set myself a project that happens to include GUI work (I figure if I can't have a GUI w/ Haskell, then it's back to C++), so I downloaded wxHaskell, read the example, and coded up a little window with a "File" menu. That worked out ok, so I added code to correctly enable & disable menu attributes, such a disabling "Close" when there's no opened file. This also worked ok, but has left me with an organizational challenge. I have a bundle of lines like this: mNew <- menuItem mFile [text := "&New"] ... which isn't a big deal, but then when I want to code the actual event handlers, I end up with these huge parameter lists, with each of the items in question an individual variable. If this were C or C++, I'd have each of these guys as a property of a structure or class, and then just pass around the structure as a whole. What's the "right" way to do this with wxHaskell? thanks in advance, James |-----------------------------------------------| | James Mitchell | http://www.jimdesu.us | |-----------------------------------------------| |When the shoe fits, the foot is forgotten; when| |the belt fits, the belly is forgotten; when the| |heart is right, "for" and "against" are | |forgotten. -- Chuang Tzu | |-----------------------------------------------| __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail |