diff options
| author | Raymond Hogenson <rhogenson@posteo.net> | 2018-05-17 15:51:37 -0800 |
|---|---|---|
| committer | Raymond Hogenson <rhogenson@posteo.net> | 2018-05-17 15:51:37 -0800 |
| commit | 5eb611756409569e23ee044784672be1430cbc4f (patch) | |
| tree | 9d7ad4aac47d3e70faef226e07886694ea09de2d /main.hs | |
| parent | ec7b593bfa656d882462b474e53424411fc0c86f (diff) | |
| download | hsc-5eb611756409569e23ee044784672be1430cbc4f.tar.zst | |
Display output in an entry
It looks a lot nicer this way. I've also cleaned up the window
management code. I'm pleased at this point at how nice gtk is. I'll
maybe even make more graphical applications in the future. It doesn't
look as nice as dmenu, though. I wonder if it's possible to theme it
like dmenu? Probably not without significant difficulty, and I'd be
fighting it every step of the way. That's just a guess.
Diffstat (limited to 'main.hs')
| -rw-r--r-- | main.hs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -7,11 +7,11 @@ import qualified RealCalc main :: IO () main = do _ <- initGUI w <- windowNew - windowSetKeepAbove w True - set w [ windowDecorated := False, windowTypeHint := WindowTypeHintDock, windowResizable := False ] + set w [ windowDecorated := False, windowResizable := False ] grid <- gridNew input <- entryNew - output <- labelNew (Nothing :: Maybe String) + output <- entryNew + set output [ entryEditable := False ] clip <- Cl.liftIO $ clipboardGet selectionPrimary gridAttach grid input 0 0 1 1 gridAttach grid output 0 1 1 1 @@ -30,7 +30,7 @@ main = do _ <- initGUI case RealCalc.calculate s of Nothing -> return () Just r -> do Cl.liftIO $ clipboardSetText clip r - Cl.liftIO $ labelSetText output r + Cl.liftIO $ set output [ entryText := r ] return False widgetShowAll w mainGUI |
