?? mainsimplelistbox.hs
字號:
{- This program displays a list box (initially empty). The user adds new items by typing a line into the keyboard, and deletes items by selecting them in the list box. -}module Main whereimport Control.Concurrentimport Computationimport Eventsimport Focusimport DialogWinimport SimpleListBoximport HTkhandleSelections :: SimpleListBox String -> Event [SimpleListBoxItem String] -> Event ()handleSelections simpleListBox event = do selections <- event always (mapM (deleteItem simpleListBox) selections ) handleSelections simpleListBox eventhandleAdditions :: SimpleListBox String -> IO ()handleAdditions simpleListBox = do nextItem <- getLine addItemAtEnd simpleListBox nextItem handleAdditions simpleListBoxmain = do main <- initHTk [text "Simple List Box"] simpleListBox <- newSimpleListBox main id [size (10,15)] (event,terminator) <- bindSelection simpleListBox spawnEvent (handleSelections simpleListBox event) pack simpleListBox [] handleAdditions simpleListBox
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -