diff --git a/Paths_hsfm.html b/Paths_hsfm.html index 9edbce3..0bd468a 100644 --- a/Paths_hsfm.html +++ b/Paths_hsfm.html @@ -1,4 +1,4 @@ Paths_hsfm

hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

Paths_hsfm

Documentation

\ No newline at end of file +

hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

Paths_hsfm

Documentation

\ No newline at end of file diff --git a/src/HSFM-GUI-Gtk-MyGUI.html b/src/HSFM-GUI-Gtk-MyGUI.html index cc5e42d..26ac307 100644 --- a/src/HSFM-GUI-Gtk-MyGUI.html +++ b/src/HSFM-GUI-Gtk-MyGUI.html @@ -54,55 +54,58 @@ -- |Set up the GUI. This only creates the permanent widgets. createMyGUI :: IO MyGUI createMyGUI = do - - let settings' = MkFMSettings False True 24 - settings <- newTVarIO settings' - operationBuffer <- newTVarIO None - - builder <- builderNew - builderAddFromFile builder =<< getDataFileName "data/Gtk/builder.xml" - - -- get the pre-defined gui widgets - rootWin <- builderGetObject builder castToWindow - "rootWin" - menubarFileQuit <- builderGetObject builder castToImageMenuItem - "menubarFileQuit" - menubarHelpAbout <- builderGetObject builder castToImageMenuItem - "menubarHelpAbout" - statusBar <- builderGetObject builder castToStatusbar - "statusBar" - clearStatusBar <- builderGetObject builder castToButton - "clearStatusBar" - fpropGrid <- builderGetObject builder castToGrid - "fpropGrid" - fpropFnEntry <- builderGetObject builder castToEntry - "fpropFnEntry" - fpropLocEntry <- builderGetObject builder castToEntry - "fpropLocEntry" - fpropTsEntry <- builderGetObject builder castToEntry - "fpropTsEntry" - fpropModEntry <- builderGetObject builder castToEntry - "fpropModEntry" - fpropAcEntry <- builderGetObject builder castToEntry - "fpropAcEntry" - fpropFTEntry <- builderGetObject builder castToEntry - "fpropFTEntry" - fpropPermEntry <- builderGetObject builder castToEntry - "fpropPermEntry" - fpropLDEntry <- builderGetObject builder castToEntry - "fpropLDEntry" - notebook <- builderGetObject builder castToNotebook - "notebook" - - -- construct the gui object - let menubar = MkMenuBar {..} - let fprop = MkFilePropertyGrid {..} - let mygui = MkMyGUI {..} - - -- sets the default icon - _ <- windowSetDefaultIconFromFile - =<< getDataFileName "data/Gtk/icons/hsfm.png" - - return mygui + let settings' = MkFMSettings False True 24 + settings <- newTVarIO settings' + operationBuffer <- newTVarIO None + + builder <- builderNew + builderAddFromFile builder =<< getDataFileName "data/Gtk/builder.xml" + + -- get the pre-defined gui widgets + rootWin <- builderGetObject builder castToWindow + "rootWin" + menubarFileQuit <- builderGetObject builder castToImageMenuItem + "menubarFileQuit" + menubarHelpAbout <- builderGetObject builder castToImageMenuItem + "menubarHelpAbout" + statusBar <- builderGetObject builder castToStatusbar + "statusBar" + clearStatusBar <- builderGetObject builder castToButton + "clearStatusBar" + fpropGrid <- builderGetObject builder castToGrid + "fpropGrid" + fpropFnEntry <- builderGetObject builder castToEntry + "fpropFnEntry" + fpropLocEntry <- builderGetObject builder castToEntry + "fpropLocEntry" + fpropTsEntry <- builderGetObject builder castToEntry + "fpropTsEntry" + fpropModEntry <- builderGetObject builder castToEntry + "fpropModEntry" + fpropAcEntry <- builderGetObject builder castToEntry + "fpropAcEntry" + fpropFTEntry <- builderGetObject builder castToEntry + "fpropFTEntry" + fpropPermEntry <- builderGetObject builder castToEntry + "fpropPermEntry" + fpropLDEntry <- builderGetObject builder castToEntry + "fpropLDEntry" + notebook <- builderGetObject builder castToNotebook + "notebook" + + -- this is required so that hotkeys work as expected, because + -- we then can connect to signals from `viewBox` more reliably + widgetSetCanFocus notebook False + + -- construct the gui object + let menubar = MkMenuBar {..} + let fprop = MkFilePropertyGrid {..} + let mygui = MkMyGUI {..} + + -- sets the default icon + _ <- windowSetDefaultIconFromFile + =<< getDataFileName "data/Gtk/icons/hsfm.png" + + return mygui diff --git a/src/HSFM-GUI-Gtk-MyView.html b/src/HSFM-GUI-Gtk-MyView.html index cd7f609..4f48e6f 100644 --- a/src/HSFM-GUI-Gtk-MyView.html +++ b/src/HSFM-GUI-Gtk-MyView.html @@ -117,11 +117,11 @@ notebookSetTabReorderable (notebook mygui) (viewBox myview) True catchIOError (refreshView mygui myview item) $ \e -> do - unless (isUserError e) (ioError e) - file <- readFile getFileInfo . fromJust . P.parseAbs . fromString - $ "/" - refreshView mygui myview file - labelSetText label (fromString "/" :: String) + file <- readFile getFileInfo . fromJust . P.parseAbs . fromString + $ "/" + refreshView mygui myview file + labelSetText label (fromString "/" :: String) + unless (isUserError e) (ioError e) -- close callback _ <- ebox `on` buttonPressEvent $ do