mainsimplebutton.hs

来自「HTK系列的」· HS 代码 · 共 26 行

HS
26
字号
{- "Goodbye" demo as discussed on the Haskell mailing list.    Specification: pops up a window saying "Hello World" and presenting a   button saying "Bye".  Clicking the button once changes the message to   "Goodbye"; clicking it a second time causes the program to quit.   -}module Main whereimport Computationimport Eventsimport HTkmain =   do      mainWin <- initHTk [text "Hello World"]      label <- newLabel mainWin [text "Hello World"]      button <- newButton mainWin [text "Bye"]      pack label []      pack button []      buttonClicked <- clicked button      sync buttonClicked      label # text "Goodbye"      sync buttonClicked      destroy mainWin      

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?