diff --git a/Gtk.hs b/Gtk.hs index 85eefc4..a92d8e6 100644 --- a/Gtk.hs +++ b/Gtk.hs @@ -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 diff --git a/Main.hs b/Main.hs index afbd2aa..b0ebfc8 100644 --- a/Main.hs +++ b/Main.hs @@ -1,4 +1,8 @@ import Gtk +import System.Environment + main :: IO () -main = startGUI +main = do + [a] <- getArgs + startGUI a