module ShellCmdInputView where import Graphics.UI.Gtk import Graphics.UI.Gtk.ModelView as MV import qualified TextInputView as TV data ViewState = V { mainWidget :: Widget , executeB :: Button , exitCodeL :: Label , textView :: TextView , cancelB :: Button , shellE :: Entry , tvv :: TV.ViewState } new buf fileButtons = do shellH <- hBoxNew False 2 shellE <- entryNew entrySetText shellE "/bin/bash" shellL <- labelNew $ Just "shell: " boxPackStart shellH shellL PackNatural 2 boxPackStart shellH shellE PackGrow 2 tvv@(TV.V mainW execB exitL cmdE cancB) <- TV.new buf fileButtons vbox <- vBoxNew False 2 boxPackStart vbox shellH PackGrow 2 boxPackStart vbox mainW PackGrow 2 return $ V (toWidget vbox) execB exitL cmdE cancB shellE tvv