Allow setting a startFile via cli

This commit is contained in:
hasufell 2014-10-01 21:47:54 +02:00
parent fc80b95665
commit 3c140832bc
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
2 changed files with 8 additions and 3 deletions

5
Gtk.hs
View File

@ -10,8 +10,8 @@ import Graphics.UI.Gtk.Windows.MessageDialog
import System.Directory import System.Directory
startGUI :: IO () startGUI :: FilePath -> IO ()
startGUI = do startGUI startFile = do
homedir <- getHomeDirectory homedir <- getHomeDirectory
-- init gui -- init gui
@ -53,6 +53,7 @@ startGUI = do
_ <- windowSetTypeHint window WindowTypeHintDialog _ <- windowSetTypeHint window WindowTypeHintDialog
containerSetBorderWidth box2 10 containerSetBorderWidth box2 10
_ <- fileChooserSetCurrentFolder fileButton homedir _ <- fileChooserSetCurrentFolder fileButton homedir
_ <- fileChooserSetFilename fileButton startFile
-- callbacks -- callbacks
_ <- onDestroy window mainQuit _ <- onDestroy window mainQuit

View File

@ -1,4 +1,8 @@
import Gtk import Gtk
import System.Environment
main :: IO () main :: IO ()
main = startGUI main = do
[a] <- getArgs
startGUI a