From: Duncan C. <dun...@us...> - 2005-01-16 14:15:47
|
Update of /cvsroot/gtk2hs/gtk2hs/demo/profileviewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14288/demo/profileviewer Modified Files: Makefile ProfileViewer.hs Log Message: Update all the demos to use the new module names and write new makefiles. Index: ProfileViewer.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/demo/profileviewer/ProfileViewer.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ProfileViewer.hs 3 Aug 2004 04:26:08 -0000 1.2 +++ ProfileViewer.hs 16 Jan 2005 14:15:35 -0000 1.3 @@ -15,15 +15,16 @@ module Main where -import Gtk -import Mogul -import Glade +import Graphics.UI.Gtk +import Graphics.UI.Gtk.Mogul +import Graphics.UI.Gtk.Glade import ParseProfile import Maybe (isJust, fromJust) import Monad (when) import List (unfoldr, intersperse) +import System (getArgs) import Data.IORef main :: IO () @@ -135,6 +136,13 @@ [(0, "allEntries"), (1, "0.1%Entries"), (5, "0.5%Entries"), (10, "1%Entries"), (50, "5%Entries"), (100, "10%Entries"), (500, "50%Entries")] + -- Check the command line to see if a profile file was given + commands <- getArgs + when (not (null commands)) + (do profile <- parseProfileFile (head commands) + writeIORef profileVar (Just profile) + repopulateTreeStore) + -- The final step is to display the main window and run the main loop widgetShowAll mainWindow mainGUI Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/demo/profileviewer/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 3 Aug 2004 04:26:08 -0000 1.2 +++ Makefile 16 Jan 2005 14:15:35 -0000 1.3 @@ -1,11 +1,9 @@ -TOP = ../.. - -include $(TOP)/mk/config.mk -MAIN = ProfileViewer.hs - -APPNAME = profileviewer +PROG = profileviewer +SOURCES = ProfileViewer.hs ParseProfile.hs -NEEDPACKAGES = gtk2 mogul glade +$(PROG) : $(SOURCES) + ghc --make $< -o $@ $(HCFLAGS) -include $(TOP)/mk/common.mk +clean: + rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROG) |