Allow setting a startFile via cli

This commit is contained in:
2014-10-01 21:47:54 +02:00
parent fc80b95665
commit 3c140832bc
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
startGUI :: IO ()
startGUI = do
startGUI :: FilePath -> IO ()
startGUI startFile = do
homedir <- getHomeDirectory
-- init gui
@@ -53,6 +53,7 @@ startGUI = do
_ <- windowSetTypeHint window WindowTypeHintDialog
containerSetBorderWidth box2 10
_ <- fileChooserSetCurrentFolder fileButton homedir
_ <- fileChooserSetFilename fileButton startFile
-- callbacks
_ <- onDestroy window mainQuit

View File

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