From 5eb611756409569e23ee044784672be1430cbc4f Mon Sep 17 00:00:00 2001 From: Raymond Hogenson Date: Thu, 17 May 2018 15:51:37 -0800 Subject: 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. --- main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.hs') 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 -- cgit v1.3.1