Commit 9f76defd authored by James Brock's avatar James Brock

replaceOutput runs without flickering the GUI

Also export `OutputMsg` constructors so that users can call
`setField` on an `OutputWidget` to write their own `replaceOutput`
functions.
parent dfcbe59c
......@@ -77,4 +77,6 @@ import IHaskell.Display.Widgets.Common as X
import IHaskell.Display.Widgets.Types as X (setField, getField, properties, triggerDisplay,
triggerChange, triggerClick, triggerSelection,
triggerSubmit, ChildWidget(..), StyleWidget(..),
WidgetFieldPair(..), Date(..), unlink, JSONByteString(..))
WidgetFieldPair(..), Date(..), unlink,
JSONByteString(..), OutputMsg(..))
......@@ -107,8 +107,8 @@ clearOutput_ widget = widgetClearOutput True >> clearOutput' widget
-- | Replace the currently displayed output for output widget
replaceOutput :: IHaskellDisplay a => OutputWidget -> a -> IO ()
replaceOutput widget d = do
clearOutput_ widget
appendDisplay widget d
disp <- display d
setField widget Outputs [OutputData disp]
instance IHaskellWidget OutputWidget where
getCommUUID = uuid
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment