aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.hs b/main.hs
index 3c3d457..760e02f 100644
--- a/main.hs
+++ b/main.hs
@@ -12,6 +12,7 @@ main = do _ <- initGUI
grid <- gridNew
input <- entryNew
output <- labelNew (Nothing :: Maybe String)
+ clip <- Cl.liftIO $ clipboardGet selectionPrimary
gridAttach grid input 0 0 1 1
gridAttach grid output 0 1 1 1
containerAdd w grid
@@ -28,7 +29,8 @@ main = do _ <- initGUI
s <- Cl.liftIO $ entryGetText input
case RealCalc.calculate s of
Nothing -> return ()
- Just r -> Cl.liftIO $ labelSetText output r
+ Just r -> do Cl.liftIO $ clipboardSetText clip r
+ Cl.liftIO $ labelSetText output r
return False
widgetShowAll w
mainGUI