Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add stub functions to handle remaining menu items

darcs-hash:20060809073553-4b390-3cdd2c015649099a78d75d365fbe922d73ee478a.gz
  • Loading branch information...
commit 5a12db036aeaa10160237b8176221d9716755d3b 1 parent a68008e
@kfish authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 src/cairo-appbase.hs
View
29 src/cairo-appbase.hs
@@ -42,6 +42,10 @@ main = do
-- get a handle on widgets from the glade file
window <- get G.castToWindow "window1"
+ -- set up File->New
+ new1 <- get G.castToMenuItem "new1"
+ G.onActivateLeaf new1 $ myNew
+
-- set up the File->Open dialog
open1 <- get G.castToMenuItem "open1"
openDialog <- get G.castToFileChooserDialog "opendialog"
@@ -56,6 +60,16 @@ main = do
G.onActivateLeaf save1 $ G.widgetShow saveDialog
G.onResponse saveDialog $ myFileSave saveDialog
+ -- set up Edit menu
+ cut1 <- get G.castToMenuItem "cut1"
+ G.onActivateLeaf cut1 $ myCut
+ copy1 <- get G.castToMenuItem "copy1"
+ G.onActivateLeaf copy1 $ myCopy
+ paste1 <- get G.castToMenuItem "paste1"
+ G.onActivateLeaf paste1 $ myPaste
+ delete1 <- get G.castToMenuItem "delete1"
+ G.onActivateLeaf delete1 $ myDelete
+
-- set up the Help->About dialog
about1 <- get G.castToMenuItem "about1"
aboutdialog1 <- get G.castToAboutDialog "aboutdialog1"
@@ -76,6 +90,9 @@ main = do
G.widgetShowAll window
G.mainGUI
+myNew :: IO ()
+myNew = putStrLn "New"
+
myFileOpen :: G.FileChooserDialog -> G.ResponseId -> IO ()
myFileOpen fcdialog response = do
case response of
@@ -89,6 +106,18 @@ myFileOpen fcdialog response = do
myFileSave :: G.FileChooserDialog -> G.ResponseId -> IO ()
myFileSave = myFileOpen
+myCut :: IO ()
+myCut = putStrLn "Cut"
+
+myCopy :: IO ()
+myCopy = putStrLn "Copy"
+
+myPaste :: IO ()
+myPaste = putStrLn "Paste"
+
+myDelete :: IO ()
+myDelete = putStrLn "Delete"
+
updateCanvas :: G.DrawingArea -> IO Bool
updateCanvas canvas = do
win <- G.drawingAreaGetDrawWindow canvas
Please sign in to comment.
Something went wrong with that request. Please try again.