Haskell gtk2hs closing aboutDialogs
I'm having some trouble with the close buttons of aboutDialogs in gtk2hs. Here is my code
aboutMenuAction <- xmlGetWidget xml castToMenuItem "menuAbout"
onActivateLeaf aboutMenuAction $ do ad <- aboutDialogNew
aboutDialogSetName ad "..."
aboutDialogSetAuthors ad ["...","..."]
widgetShowAll ad
This displays the aboutDialog fine, but the close button doesn't fu开发者_StackOverflow社区nction at all. I wasn't able to find much about this, and have no idea how to get the close button functioning.
Cheers, Josh.
This works for me:
about = do
ad <- aboutDialogNew
aboutDialogSetName ad "Horde Test Program"
aboutDialogSetVersion ad "1.0"
aboutDialogSetAuthors ad $ ["Thomas M. DuBuisson "
++ "<Thomas.DuBuisson@gmail.com>"]
aboutDialogSetComments ad $ ""
dialogRun ad
widgetDestroy ad
And to create that about
dialog I have some buttons:
qa <- buttonNewFromStock stockAbout
onClicked qa $ about
-- ...
bb <- hButtonBoxNew
containerAdd bb qa
Disclaimer: For this program I took the carsim GTK demo as a starting point, so the code and even variable names probably still match that.
精彩评论