diff options
| author | Raymond Hogenson <rhogenson@posteo.net> | 2018-05-17 11:06:09 -0800 |
|---|---|---|
| committer | Raymond Hogenson <rhogenson@posteo.net> | 2018-05-17 11:06:09 -0800 |
| commit | ec7b593bfa656d882462b474e53424411fc0c86f (patch) | |
| tree | c8eabc5c8f32f5b58d87df2f22983aa014ee3a23 /main.hs | |
| parent | fab7cfc21284d873a27aa60697bdb7706a9afa41 (diff) | |
| download | hsc-ec7b593bfa656d882462b474e53424411fc0c86f.tar.zst | |
Copy the result to the clipboard
It's copied to the primary selection since that's most convenient for
me. I hope that's not confusing for anyone. Next step, multithreading.
Diffstat (limited to 'main.hs')
| -rw-r--r-- | main.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |
