#1109: toggleActionIsActive in ToggleActionEntry not changed when user checks or
unchecks menu item
---------------------------------------------+------------------------------
Reporter: guest | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: general (Gtk+, Glib) | Version: 0.9.12
Keywords: menu, toolbar,ToggleActionEntry |
---------------------------------------------+------------------------------
Using the package ghc682-gtk2hs - 0.9.12.1-6.fc8.i386 for Fedora 8,
the field
{{{
toggleActionIsActive
}}}
is not changed when the user checks or unchecks
a menu item.
{{{
data ToggleActionEntry = ToggleActionEntry {
toggleActionName :: String
toggleActionLabel :: String
toggleActionStockId :: (Maybe String)
toggleActionAccelerator :: (Maybe String)
toggleActionTooltip :: (Maybe String)
toggleActionCallback :: (IO ())
toggleActionIsActive :: Bool
}
}}}
There is a workaround, because the toggleActionCallback function does work
when the user checks or unchecks an item. This can be used to set or unset
an IORef.
Example:
{{{
myTog :: IORef Bool -> IO ()
myTog chk = do old <- readIORef chk
writeIORef chk (not old)
}}}
in:
{{{
duptogg = ToggleActionEntry "DupCheck" "Check Data" (Just stockConvert)
Nothing
(Just "Check facts for duplicates") (myTog
dupcheck) True
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/gtk2hs/ticket/1109>
Gtk2Hs <http://haskell.org/gtk2hs/>
The Gtk2Hs project
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gtk2hs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel