|
From: <kr_...@us...> - 2003-03-25 23:37:09
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv16872/src/Graphics/UI/GIO
Modified Files:
Controls.hs Events.hs Menu.hs Timer.hs Window.hs
Log Message:
The new implementation of Events allows usage of setHandler/setDefHandler/getHandler functional tripple
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Controls.hs 29 Jan 2003 16:16:06 -0000 1.3
--- Controls.hs 25 Mar 2003 23:37:01 -0000 1.4
***************
*** 35,40 ****
--------------------------------------------------------------------}
-- | A simple text label.
! data Label = Label { lhandle :: WindowHandle
! , lparent :: WindowHandle
}
--- 35,40 ----
--------------------------------------------------------------------}
-- | A simple text label.
! data Label = Label { lhandle :: !WindowHandle
! , lparent :: !WindowHandle
}
***************
*** 65,71 ****
--------------------------------------------------------------------}
-- | A standard push button.
! data Button = Button { bhandle :: WindowHandle
! , bparent :: WindowHandle
! , bcommand :: EventHandler (IO ()) }
-- | Create a button.
--- 65,71 ----
--------------------------------------------------------------------}
-- | A standard push button.
! data Button = Button { bhandle :: !WindowHandle
! , bparent :: !WindowHandle
! }
-- | Create a button.
***************
*** 74,79 ****
= do but <- do hwnd <- get w windowHandle
hbut <- Port.createButton hwnd
! bcmd <- newEventHandler
! return (Button hbut hwnd bcmd)
set but props
return but
--- 74,78 ----
= do but <- do hwnd <- get w windowHandle
hbut <- Port.createButton hwnd
! return (Button hbut hwnd)
set but props
return but
***************
*** 95,99 ****
instance Commanding Button where
command
! = newButtonClickEvent bhandle bcommand
{--------------------------------------------------------------------
--- 94,98 ----
instance Commanding Button where
command
! = newControlCommandEvent bhandle
{--------------------------------------------------------------------
***************
*** 101,106 ****
--------------------------------------------------------------------}
-- | A standard text entry control.
! data Entry = Entry { ehandle :: WindowHandle
! , eparent :: WindowHandle
}
--- 100,105 ----
--------------------------------------------------------------------}
-- | A standard text entry control.
! data Entry = Entry { ehandle :: !WindowHandle
! , eparent :: !WindowHandle
}
***************
*** 135,141 ****
-- command handler automatically calls a handler associated with a
-- selected item.
! data Popup = Popup { phandle :: WindowHandle
! , pparent :: WindowHandle
! , pcommand :: EventHandler (IO ())
, pitems :: Var [(String,IO ())]
}
--- 134,139 ----
-- command handler automatically calls a handler associated with a
-- selected item.
! data Popup = Popup { phandle :: !WindowHandle
! , pparent :: !WindowHandle
, pitems :: Var [(String,IO ())]
}
***************
*** 146,152 ****
= do p <- do hwnd <- get w windowHandle
hpop <- Port.createPopUp hwnd
- pcmd <- newEventHandler
pitems <- newVar []
! return (Popup hpop hwnd pcmd pitems)
set p [on command =: popupCommand p]
set p props
--- 144,149 ----
= do p <- do hwnd <- get w windowHandle
hpop <- Port.createPopUp hwnd
pitems <- newVar []
! return (Popup hpop hwnd pitems)
set p [on command =: popupCommand p]
set p props
***************
*** 188,192 ****
instance Commanding Popup where
command
! = newPopupClickEvent phandle pcommand
{--------------------------------------------------------------------
--- 185,189 ----
instance Commanding Popup where
command
! = newControlCommandEvent phandle
{--------------------------------------------------------------------
***************
*** 195,199 ****
-- | A check control group.
data CheckGroup = CheckGroup{ checks :: [Check]
! , cgparent :: WindowHandle
, cglayout :: Var ([Check] -> Layout)
}
--- 192,196 ----
-- | A check control group.
data CheckGroup = CheckGroup{ checks :: [Check]
! , cgparent :: !WindowHandle
, cglayout :: Var ([Check] -> Layout)
}
***************
*** 251,255 ****
data RadioGroup = RadioGroup{ radios :: [Radio]
, commands:: [IO ()]
! , gparent :: WindowHandle
, gselect :: Var Int
, glayout :: Var ([Radio] -> Layout)
--- 248,252 ----
data RadioGroup = RadioGroup{ radios :: [Radio]
, commands:: [IO ()]
! , gparent :: !WindowHandle
, gselect :: Var Int
, glayout :: Var ([Radio] -> Layout)
***************
*** 308,314 ****
--------------------------------------------------------------------}
-- | A single check control.
! data Check = Check{ chandle :: WindowHandle
! , cparent :: WindowHandle
! , ccommand :: EventHandler (IO ())
}
--- 305,310 ----
--------------------------------------------------------------------}
-- | A single check control.
! data Check = Check{ chandle :: !WindowHandle
! , cparent :: !WindowHandle
}
***************
*** 318,323 ****
= do c <- do hwnd <- get w windowHandle
hcheck <- Port.createCheckBox hwnd txt
! ccmd <- newEventHandler
! return (Check hcheck hwnd ccmd)
set c props
return c
--- 314,318 ----
= do c <- do hwnd <- get w windowHandle
hcheck <- Port.createCheckBox hwnd txt
! return (Check hcheck hwnd)
set c props
return c
***************
*** 331,335 ****
instance Commanding Check where
! command = newCheckClickEvent chandle ccommand
instance Control Check where
--- 326,330 ----
instance Commanding Check where
! command = newControlCommandEvent chandle
instance Control Check where
***************
*** 340,346 ****
--------------------------------------------------------------------}
-- | A single radio control.
! data Radio = Radio{ rhandle :: WindowHandle
! , rparent :: WindowHandle
! , rcommand :: EventHandler (IO ())
}
--- 335,340 ----
--------------------------------------------------------------------}
-- | A single radio control.
! data Radio = Radio{ rhandle :: !WindowHandle
! , rparent :: !WindowHandle
}
***************
*** 356,361 ****
= do r <- do hwnd <- get w windowHandle
hradio <- Port.createRadioBox hwnd first txt
! rcmd <- newEventHandler
! return (Radio hradio hwnd rcmd)
set r props
return r
--- 350,354 ----
= do r <- do hwnd <- get w windowHandle
hradio <- Port.createRadioBox hwnd first txt
! return (Radio hradio hwnd)
set r props
return r
***************
*** 367,371 ****
instance Commanding Radio where
! command = newRadioClickEvent rhandle rcommand
instance Control Radio where
--- 360,364 ----
instance Commanding Radio where
! command = newControlCommandEvent rhandle
instance Control Radio where
Index: Events.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Events.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Events.hs 31 Jan 2003 21:06:40 -0000 1.4
--- Events.hs 25 Mar 2003 23:37:02 -0000 1.5
***************
*** 87,95 ****
-- * Internal
- -- ** Event handlers
- , EventHandler
- , newEventHandler
- , hasEventHandler
-
-- ** Standard events
-- *** Forms
--- 87,90 ----
***************
*** 104,114 ****
, newKeyboardEvent
-- *** Controls
! , newButtonClickEvent
! , newPopupClickEvent
! , newRadioClickEvent
! , newCheckClickEvent
-- *** Paint
- , PaintFunctionWrapper
, newPaintEvent
-- *** Misc
--- 99,105 ----
, newKeyboardEvent
-- *** Controls
! , newControlCommandEvent
-- *** Paint
, newPaintEvent
-- *** Misc
***************
*** 117,125 ****
-- ** Generic event creators
, newEvent
! , StdEvent, StdWindowEvent
! , stdWindowEvent0
! , stdWindowEvent1
, stdWindowEvent
- , stdEvent
) where
--- 108,113 ----
-- ** Generic event creators
, newEvent
! , StdWindowEvent
, stdWindowEvent
) where
***************
*** 134,148 ****
--------------------------------------------------------------------}
-- | An event for a widget @w@ that expects an event handler of type @a@.
! data Event w a = Event (Attr w a)
-- | Get the event handler attribute for a certain event.
on :: Event w a -> Attr w a
! on (Event attr)
= attr
-- | Change the event type.
mapEvent :: (a -> b) -> (a -> b -> a) -> Event w a -> Event w b
! mapEvent get set (Event attr)
! = Event (mapAttr get set attr)
{--------------------------------------------------------------------
--- 122,140 ----
--------------------------------------------------------------------}
-- | An event for a widget @w@ that expects an event handler of type @a@.
! data Event w a = Event (Attr w a) (Prop w)
-- | Get the event handler attribute for a certain event.
on :: Event w a -> Attr w a
! on (Event attr off)
= attr
+ off :: Event w a -> Prop w
+ off (Event attr off)
+ = off
+
-- | Change the event type.
mapEvent :: (a -> b) -> (a -> b -> a) -> Event w a -> Event w b
! mapEvent get set (Event attr off)
! = Event (mapAttr get set attr) off
{--------------------------------------------------------------------
***************
*** 322,344 ****
prev keyboardEvent
-
-
- {--------------------------------------------------------------------
- A standard event handler for widget implementations
- --------------------------------------------------------------------}
- -- | A standard event handler.
- type EventHandler a = Var (Maybe a)
-
- -- | Create a fresh event handler
- newEventHandler :: IO (EventHandler a)
- newEventHandler
- = newVar Nothing
-
- -- | Returns 'True' if there is a registered event handler.
- hasEventHandler :: EventHandler a -> IO Bool
- hasEventHandler eh
- = do mbhandler <- getVar eh
- return (isJust mbhandler)
-
{--------------------------------------------------------------------
Standard event creations
--- 314,317 ----
***************
*** 346,400 ****
-- Forms
newDismissEvent, newActivateEvent, newDeactivateEvent :: StdWindowEvent w (IO ())
! newDismissEvent = stdWindowEvent0 Lib.registerWindowDismiss
! newActivateEvent = stdWindowEvent0 Lib.registerWindowActivate
! newDeactivateEvent= stdWindowEvent0 Lib.registerWindowDeactivate
newResizeEvent :: StdWindowEvent w (Size -> IO ())
! newResizeEvent = stdWindowEvent1 Lib.registerWindowResize
newScrollEvent :: StdWindowEvent w (Point -> IO ())
! newScrollEvent = stdWindowEvent1 Lib.registerWindowScroll
-- Reactive
newClosingEvent :: StdWindowEvent w (IO ())
! newClosingEvent = stdWindowEvent0 Lib.registerWindowDestroy
newMouseEvent :: StdWindowEvent w (MouseEvent -> IO ())
! newMouseEvent = stdWindowEvent1 Lib.registerWindowMouse
newKeyboardEvent :: StdWindowEvent w (KeyboardEvent -> IO ())
! newKeyboardEvent = stdWindowEvent1 Lib.registerWindowKeyboard
-- commands
! newButtonClickEvent :: StdWindowEvent w (IO ())
! newButtonClickEvent = stdWindowEvent0 Lib.registerButtonClick
!
! newPopupClickEvent :: StdWindowEvent w (IO ())
! newPopupClickEvent = stdWindowEvent0 Lib.registerPopUpClick
!
! newRadioClickEvent :: StdWindowEvent w (IO ())
! newRadioClickEvent = stdWindowEvent0 Lib.registerRadioBoxClick
!
! newCheckClickEvent :: StdWindowEvent w (IO ())
! newCheckClickEvent = stdWindowEvent0 Lib.registerCheckBoxClick
{--------------------------------------------------------------------
Special event creators
--------------------------------------------------------------------}
- type PaintFunctionWrapper w = w -> PaintFunction -> CanvasHandle -> Rect -> IO ()
-- | Create a paint event.
! newPaintEvent :: PaintFunctionWrapper w -- ^ convert from paint function
! -> StdWindowEvent w PaintFunction
! newPaintEvent convert getWindowHandle getEventVar
! = stdEvent (\_ _ _ -> return ())
! (\w fun -> Lib.registerWindowPaint (getWindowHandle w) (convert w fun))
! getEventVar
!
-- | Create a new generic event for menu command.
! newMenuEvent :: (w -> MenuHandle) -> (w -> EventHandler (IO ())) -> Event w (IO ())
! newMenuEvent getMenuHandle getEventVar
! = stdEvent (return ()) (\m io -> Lib.registerMenuCommand (getMenuHandle m) io) getEventVar
--- 319,361 ----
-- Forms
newDismissEvent, newActivateEvent, newDeactivateEvent :: StdWindowEvent w (IO ())
! newDismissEvent = stdWindowEvent Lib.getWindowDismissHandler Lib.setWindowDismissHandler Lib.setWindowDismissDefHandler
! newActivateEvent = stdWindowEvent Lib.getWindowActivateHandler Lib.setWindowActivateHandler Lib.setWindowActivateDefHandler
! newDeactivateEvent= stdWindowEvent Lib.getWindowDeactivateHandler Lib.setWindowDeactivateHandler Lib.setWindowDeactivateDefHandler
newResizeEvent :: StdWindowEvent w (Size -> IO ())
! newResizeEvent = stdWindowEvent Lib.getWindowResizeHandler Lib.setWindowResizeHandler Lib.setWindowResizeDefHandler
newScrollEvent :: StdWindowEvent w (Point -> IO ())
! newScrollEvent = stdWindowEvent Lib.getWindowScrollHandler Lib.setWindowScrollHandler Lib.setWindowScrollDefHandler
-- Reactive
newClosingEvent :: StdWindowEvent w (IO ())
! newClosingEvent = stdWindowEvent Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler
newMouseEvent :: StdWindowEvent w (MouseEvent -> IO ())
! newMouseEvent = stdWindowEvent Lib.getWindowMouseHandler Lib.setWindowMouseHandler Lib.setWindowMouseDefHandler
newKeyboardEvent :: StdWindowEvent w (KeyboardEvent -> IO ())
! newKeyboardEvent = stdWindowEvent Lib.getWindowKeyboardHandler Lib.setWindowKeyboardHandler Lib.setWindowKeyboardDefHandler
-- commands
! newControlCommandEvent :: StdWindowEvent w (IO ())
! newControlCommandEvent = stdWindowEvent Lib.getControlCommandHandler Lib.setControlCommandHandler Lib.setControlCommandDefHandler
{--------------------------------------------------------------------
Special event creators
--------------------------------------------------------------------}
-- | Create a paint event.
! newPaintEvent :: (w -> Var PaintFunction) -> (w -> PaintFunction -> CanvasHandle -> Rect -> IO ()) -> StdWindowEvent w PaintFunction
! newPaintEvent getv convert getWindowHandle
! = newEvent (getVar . getv)
! (\w h -> Lib.setWindowPaintHandler (getWindowHandle w) (convert w h) >> setVar (getv w) h)
! (\w -> Lib.setWindowPaintDefHandler (getWindowHandle w) >> setVar (getv w) (\_ _ _ -> return ()))
-- | Create a new generic event for menu command.
! newMenuEvent :: (w -> MenuHandle) -> Event w (IO ())
! newMenuEvent getMenuHandle
! = newEvent (Lib.getMenuCommandHandler . getMenuHandle) (Lib.setMenuCommandHandler . getMenuHandle) (Lib.setMenuCommandDefHandler . getMenuHandle)
***************
*** 402,441 ****
Generic event creators
--------------------------------------------------------------------}
- -- | A standard event creation function.
- type StdEvent w a = (w -> EventHandler a) -> Event w a
-- | A standard event creation function for window handles.
! type StdWindowEvent w a = (w -> WindowHandle) -> StdEvent w a
!
!
! stdWindowEvent1 :: (WindowHandle -> (a -> IO ()) -> IO ()) -> StdWindowEvent w (a -> IO ())
! stdWindowEvent1
! = stdWindowEvent (\x -> return ())
!
! stdWindowEvent0 :: (WindowHandle -> IO () -> IO ()) -> StdWindowEvent w (IO ())
! stdWindowEvent0
! = stdWindowEvent (return ())
!
! stdWindowEvent :: a -> (WindowHandle -> a -> IO ()) -> StdWindowEvent w a
! stdWindowEvent defio register getHandle getEventVar
! = stdEvent defio (\w io -> register (getHandle w) io) getEventVar
! stdEvent :: a -> (w -> a -> IO ()) -> StdEvent w a
! stdEvent defio register getEventVar
! = newEvent getter setter
! where
! getter w
! = do mbio <- getVar (getEventVar w)
! case mbio of
! Nothing -> return defio
! Just io -> return io
!
! setter w io
! = do register w io
! setVar (getEventVar w) (Just io)
!
-- | Create a new event from a get and set function.
! newEvent :: (w -> IO a) -> (w -> a -> IO ()) -> Event w a
! newEvent getter setter
! = Event (newAttr getter setter)
\ No newline at end of file
--- 363,376 ----
Generic event creators
--------------------------------------------------------------------}
-- | A standard event creation function for window handles.
! type StdWindowEvent w a = (w -> WindowHandle) -> Event w a
! stdWindowEvent :: (WindowHandle -> IO a) -> (WindowHandle -> a -> IO ()) -> (WindowHandle -> IO ()) -> StdWindowEvent w a
! stdWindowEvent getHandler setHandler setDefHandler getHandle
! = newEvent (getHandler . getHandle) (setHandler . getHandle) (setDefHandler . getHandle)
-- | Create a new event from a get and set function.
! newEvent :: (w -> IO a) -> (w -> a -> IO ()) -> (w -> IO ()) -> Event w a
! newEvent getter setter setdef
! = Event (newAttr getter setter) (newProp setdef getter setter)
Index: Menu.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Menu.hs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Menu.hs 31 Jan 2003 01:01:44 -0000 1.2
--- Menu.hs 25 Mar 2003 23:37:03 -0000 1.3
***************
*** 78,82 ****
, vkey :: Var Key
, venabled :: Var Bool
- , vcommand :: EventHandler (IO ())
}
--- 78,81 ----
***************
*** 87,93 ****
Lib.registerWindowMenu (hwindow menu) hitem
venabled <- newVar True
- vcommand <- newEventHandler
vkey <- newVar Lib.KeyNull
! return (MenuItem hitem menu title vkey venabled vcommand)
set mitem props
return mitem
--- 86,91 ----
Lib.registerWindowMenu (hwindow menu) hitem
venabled <- newVar True
vkey <- newVar Lib.KeyNull
! return (MenuItem hitem menu title vkey venabled)
set mitem props
return mitem
***************
*** 101,105 ****
instance Commanding MenuItem where
! command = newMenuEvent hitem vcommand
--- 99,103 ----
instance Commanding MenuItem where
! command = newMenuEvent hitem
Index: Timer.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Timer.hs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Timer.hs 26 Jan 2003 12:41:50 -0000 1.1.1.1
--- Timer.hs 25 Mar 2003 23:37:03 -0000 1.2
***************
*** 88,92 ****
instance Commanding Timer where
command
! = newEvent getter setter
where
getter t
--- 88,92 ----
instance Commanding Timer where
command
! = newEvent getter setter setdef
where
getter t
***************
*** 99,102 ****
--- 99,109 ----
= do setVar (vcommand t) (Just cmd)
updateTimer t
+
+ setdef t
+ = do mbtimer <- takeVar (vtimer t)
+ case mbtimer of
+ Nothing -> return ()
+ Just h -> Lib.destroyTimer h
+ putVar (vtimer t) Nothing
{--------------------------------------------------------------------
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Window.hs 31 Jan 2003 20:54:08 -0000 1.5
--- Window.hs 25 Mar 2003 23:37:03 -0000 1.6
***************
*** 37,54 ****
, vbgcolor :: Var Color
, vhatch :: Var HatchStyle
! -- reactive
! , vclosing :: EventHandler (IO ())
! , vmouse :: EventHandler (MouseEvent -> IO ())
! , vkeyboard:: EventHandler (KeyboardEvent -> IO ())
! -- form
! , vdismiss :: EventHandler (IO ())
! , vactivate:: EventHandler (IO ())
! , vdeactive:: EventHandler (IO ())
! , vscroll :: EventHandler (Point -> IO ())
! , vresize :: EventHandler (Size -> IO ())
! -- paint
! , vpaint :: EventHandler PaintFunction
! -- layout
! , vrelayout:: EventHandler (IO ())
, vlayout :: Var Layout
}
--- 37,41 ----
, vbgcolor :: Var Color
, vhatch :: Var HatchStyle
! , vpaint :: Var PaintFunction
, vlayout :: Var Layout
}
***************
*** 86,99 ****
form :: WindowHandle -> WindowHandle -> [Prop Window] -> IO Window
form hwindow hparent props
! = do w <- do vclosing <- newEventHandler
! vmouse <- newEventHandler
! vkeyboard <- newEventHandler
! vdismiss <- newEventHandler
! vactivate <- newEventHandler
! vdeactive <- newEventHandler
! vscroll <- newEventHandler
! vresize <- newEventHandler
! vpaint <- newEventHandler
! vrelayout <- newEventHandler
vautosize <- newVar True
vlayout <- newVar empty
--- 73,77 ----
form :: WindowHandle -> WindowHandle -> [Prop Window] -> IO Window
form hwindow hparent props
! = do w <- do vpaint <- newVar (\_ _ _ -> return ())
vautosize <- newVar True
vlayout <- newVar empty
***************
*** 101,116 ****
vresizeable <- newVar True
vcolor <- newVar black
! vbgcolor <- newVar dialoggrey
vhatch <- newVar HatchSolid
return (Window hwindow hparent vdomain vresizeable vautosize
! vcolor vbgcolor vhatch
! vclosing vmouse vkeyboard
! vdismiss vactivate vdeactive vscroll vresize
! vpaint vrelayout vlayout
)
recolorWindow w
- set w [domain =: sz 0 0]
- set w [on dismiss =: close w]
- set w [on keyboard =: keyboardWindow w]
set w [on relayout =: relayoutWindow w]
-- just by setting a dummy paint function, we will at least intialize the canvas properly on a repaint
--- 79,89 ----
vresizeable <- newVar True
vcolor <- newVar black
! vbgcolor <- newVar dialoggray
vhatch <- newVar HatchSolid
return (Window hwindow hparent vdomain vresizeable vautosize
! vcolor vbgcolor vhatch
! vpaint vlayout
)
recolorWindow w
set w [on relayout =: relayoutWindow w]
-- just by setting a dummy paint function, we will at least intialize the canvas properly on a repaint
***************
*** 118,127 ****
return w
-
- keyboardWindow w (KeyDown (KeyF4 mod) rep) | altDown mod
- = close w
- keyboardWindow w kbd
- = return ()
-
relayoutWindow :: Window -> IO ()
relayoutWindow w
--- 91,94 ----
***************
*** 185,189 ****
instance Widget Window where
! close w = Lib.closeWindow (hwindow w)
instance Dimensions Window where
--- 152,157 ----
instance Widget Window where
! dismissWidget w = Lib.dismissWindow (hwindow w)
! destroyWidget w = Lib.destroyWindow (hwindow w)
instance Dimensions Window where
***************
*** 205,222 ****
instance Reactive Window where
! closing = newClosingEvent hwindow vclosing
! mouse = newMouseEvent hwindow vmouse
! keyboard = newKeyboardEvent hwindow vkeyboard
instance Form Window where
! dismiss = newDismissEvent hwindow vdismiss
! activate = newActivateEvent hwindow vactivate
! deactivate= newDeactivateEvent hwindow vdeactive
! scroll = newScrollEvent hwindow vscroll
! resize = newResizeEvent hwindow vresize
instance Paint Window where
repaint w = do Lib.invalidateWindow (hwindow w)
! paint = newPaintEvent wndpaint hwindow vpaint
where
wndpaint w paintfun hcanvas updArea
--- 173,190 ----
instance Reactive Window where
! closing = newClosingEvent hwindow
! mouse = newMouseEvent hwindow
! keyboard = newKeyboardEvent hwindow
instance Form Window where
! dismiss = newDismissEvent hwindow
! activate = newActivateEvent hwindow
! deactivate= newDeactivateEvent hwindow
! scroll = newScrollEvent hwindow
! resize = newResizeEvent hwindow
instance Paint Window where
repaint w = do Lib.invalidateWindow (hwindow w)
! paint = newPaintEvent vpaint wndpaint hwindow
where
wndpaint w paintfun hcanvas updArea
***************
*** 233,237 ****
relayout :: Event Window (IO ())
relayout
! = stdWindowEvent0 Lib.registerWindowReLayout hwindow vrelayout
--- 201,205 ----
relayout :: Event Window (IO ())
relayout
! = stdWindowEvent Lib.getWindowReLayoutHandler Lib.setWindowReLayoutHandler Lib.setWindowReLayoutDefHandler hwindow
|