<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19154">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>I am trying to become acquainted with both haskell
and Gtk thru the writing of small pieces of code exercising some Gtk
functions.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Having had problems with the ToggleEntry function
(unable to get the checked/non checked status - refer to chapter 7.2 of the
Gtk2HS tutorial) I have tried to understand</FONT></DIV>
<DIV><FONT size=2 face=Arial>the toggleAction thing.</FONT></DIV>
<DIV><FONT size=2 face=Arial>So I have written this :</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>import
Graphics.UI.Gtk.ActionMenuToolbar.ToggleAction</FONT></DIV>
<DIV><FONT size=2 face=Arial>...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>togls::[ToggleAction]<BR>togls = let stone =
toggleActionNew "STON" "Stones number" Nothing Nothing (myTog
stone) <BR>
deste =
toggleActionNew "DEST" "Destination" Nothing Nothing (myTog
deste) <BR>
state =
toggleActionNew "STAT" "Board status" Nothing Nothing (myTog
state)<BR> in
[stone,deste,state]</FONT></DIV><FONT size=2 face=Arial>
<DIV><BR>myTog::ToggleAction->IO()<BR>myTog ta = putStrLn ("The name of
the action is " ++ (toggleActionName ta)) </DIV>
<DIV> </DIV>
<DIV>The compiler is not happy with this and sends back the following:</DIV>
<DIV> </DIV>
<DIV>-------------------------------------------------------------------------------------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV>The function 'toggleActionNew' is applied to five arguments but its type
'String</DIV>
<DIV>
->String</DIV>
<DIV> ->Maybe
String</DIV>
<DIV> -> Maybe
stockId</DIV>
<DIV>
->IO ToggleAction</DIV>
<DIV>has only four.</DIV>
<DIV> </DIV>
<DIV>-------------------------------------------------------------------------------------------------------------------------------------------</DIV>
<DIV>To me, stone has 4 parameters ("STON", "Stones number", Nothing,Nothing)
and a result (myTog stone) as in the definition given by the compiler.</DIV>
<DIV>I am using ghc-7.0.3</DIV>
<DIV>
gthk+-bundle_2.16.2-20090601_win32</DIV>
<DIV>
gtk-0.12.3.1 documentation</DIV>
<DIV> </DIV>
<DIV>I am certainly missing something obvious to everybody but I could not solve
it , so I would appreciate any help on this topic.</DIV>
<DIV> </DIV>
<DIV>Thanks in advance</DIV>
<DIV> </DIV>
<DIV><A href="mailto:p.michallet@free.fr">p.michallet@free.fr</A></DIV>
<DIV> </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV></BODY></HTML>