Created
July 13, 2009 13:14
-
-
Save thiagoarrais/146102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.Gtk | |
connectAction actg accg id accelerator command = | |
do action <- actionNew id "Go!" Nothing Nothing | |
actionGroupAddActionWithAccel actg action (Just accelerator) | |
actionSetAccelGroup action accg | |
actionConnectAccelerator action | |
on action actionActivated command | |
return action | |
main = | |
do initGUI | |
window <- windowNew | |
ag <- actionGroupNew "AGR" | |
ui <- uiManagerNew | |
acg <- uiManagerGetAccelGroup ui | |
uiManagerInsertActionGroup ui ag 0 | |
windowAddAccelGroup window acg | |
connectAction ag acg "CLSE" "<Control>w" (putStrLn "Ctrl-W") | |
connectAction ag acg "TBAD" "<Control>t" (putStrLn "Ctrl-T") | |
onDestroy window mainQuit | |
widgetShowAll window | |
mainGUI | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment