From: D.V. <dav...@gm...> - 2011-09-12 07:20:02
|
Bonjour List, Thanks to Jeremy O'Donoghue's blog about events, I copied and modified two functions; but without really understanding what's going on : windowOnIconize :: Window a -> IO () -> IO () windowOnIconize win eventHandler = windowOnEvent win [wxEVT_ICONIZE] eventHandler (\evt -> eventHandler) windowGetOnIconize :: Window a -> IO (IO ()) windowGetOnIconize win = unsafeWindowGetHandlerState win wxEVT_ICONIZE skipCurrentEvent and then somewhere I added: windowOnIconize win $ putStrLn "Iconize!!!!" But I've no idea how/where to use the windowGetOnIconize function... Now when I try the program, I get the Iconize!!!! message when I (de-)iconize the window, which is great, but I segfault when I close the window. David. 2011/9/9 D.V. <dav...@gm...>: > 2011/9/9 D.V. <dav...@gm...>: >> Bonjour List, > >> I'm continuing the search, but if someone has an idea, I'm interested ! > > Looks like it's called Iconize in wxWidget slang, but now all I've > found with Iconize is > > Graphics.UI.WXCore.WxcClassTypes type IconizeEvent a = Event (CIconizeEvent a) > Graphics.UI.WXCore.WxcClassTypes data CIconizeEvent a > Graphics.UI.WXCore.WxcClassInfo classIconizeEvent :: ClassType (IconizeEvent ()) > Graphics.UI.WXCore.WxcClassInfo downcastIconizeEvent :: IconizeEvent a > -> IconizeEvent () > Graphics.UI.WXCore.WxcClassTypes type TIconizeEvent a = TEvent (CIconizeEvent a) > Graphics.UI.WXCore.WxcClassesMZ topLevelWindowIconize :: > TopLevelWindow a -> Bool -> IO Bool > Graphics.UI.WXCore.WxcClassesMZ topLevelWindowIsIconized :: > TopLevelWindow a -> IO Bool > Graphics.UI.WXCore.WxcClassesMZ wxEVT_ICONIZE :: EventId > Graphics.UI.WXCore.WxcDefs wxICONIZE :: Int > > I'm not sure how to work with events in wxCore.. > > David. > |