From: Daan L. <daa...@xs...> - 2003-10-13 19:16:27
|
> -----Original Message----- > by David Roundy > > The following code gives me "interesting" results: > > module Main where > import Graphics.UI.WX > > main = start $ do f <- frame [text := "layout demo"] > h <- staticText f [] > hello h > q <- button f [text := "quit", on command > := close f] > set f [layout := column 5 [widget h, > widget q]] > > hello st = set st [text := "Hello world!", > on click := \_ -> goodbye st] > goodbye st = set st [text := "Goodbye world!", > on click := \_ -> hello st] > > [snip] > > So my question is, am I supposed to be allowed to modify a > callback function within that callback function? I have found the bug. It is in my implementation of "event filters". There is just one primitive event, "mouse" that gets all mouse events. For convenience there is a host of "event filters" on top of "mouse". Somehow, I made a mistake in their implementation and I will try to fix it in the next release. Note that your problem goes away when you use the basic "mouse" events. -- Daan. > Obviously I > could get the same functionality either using an IORef or by > checking the current contents of the text, but I don't see > why you shouldn't be able to modify a callback within the > callback. Or perhaps there is some other more subtle problem > going on here... > -- > David Roundy > http://www.abridgegame.org > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. See > the people who have HELPED US provide better services: Click > here: http://sourceforge.net/supporters.php > _______________________________________________ > wxhaskell-users mailing list wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > > |