aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hogenson <rhogenson@posteo.net>2018-05-17 15:51:37 -0800
committerRaymond Hogenson <rhogenson@posteo.net>2018-05-17 15:51:37 -0800
commit5eb611756409569e23ee044784672be1430cbc4f (patch)
tree9d7ad4aac47d3e70faef226e07886694ea09de2d
parentec7b593bfa656d882462b474e53424411fc0c86f (diff)
downloadhsc-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.
-rw-r--r--.main.hs.swpbin0 -> 12288 bytes
-rw-r--r--main.hs8
2 files changed, 4 insertions, 4 deletions
diff --git a/.main.hs.swp b/.main.hs.swp
new file mode 100644
index 0000000..9604716
--- /dev/null
+++ b/.main.hs.swp
Binary files differ
diff --git a/main.hs b/main.hs
index 760e02f..d92c633 100644
--- a/main.hs
+++ b/main.hs
@@ -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