开发者

Haskell gtk2hs closing aboutDialogs

开发者 https://www.devze.com 2023-01-27 15:21 出处:网络
I\'m having some trouble with the close buttons of aboutDialogs in gtk2hs. Here is my code aboutMenuAction <- xmlGetWidget xml castToMenuItem \"menuAbout\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号