Merge pull request #1247 from jamesdbrock/replaceOutput

replaceOutput runs without flickering the GUI
This commit is contained in:
Vaibhav Sagar 2021-08-16 22:56:49 +10:00 committed by GitHub
commit 1aaa152f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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(..))

View File

@ -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