From: Conal E. <co...@co...> - 2007-11-29 01:44:07
|
Thanks much for the pointers, Mads. I read the binview source code, which uses a global mutable table to store per-instance data. I wonder if there'= s a nicer way. did you ever find one? - Conal On Nov 28, 2007 9:47 AM, Mads Lindstr=F8m <mad...@ya...> wrote: > Hi > > Conal Elliott wrote: > > I want to make (or find) a float-valued slider that displays its > > current value and maybe its bounds. Does anyone have advice about > > doing that sort of thing. I want the result to have have a > > control-like interface, including a gettable attribute for the current > > (float) value. Thanks, - Conal > > To have a gettable attribute you need to make the type containing the > slider an instance of Valued. See > http://wxhaskell.sourceforge.net/doc/Graphics.UI.WX.Classes.html#t% > 3AValued and: > > import qualified Graphics.UI.WX as Wx > > instance Wx.Valued YourTypeContainingTheSlider where > value =3D Wx.newAttr "Value" ioActionToGetValue ioActionToSetValue > > there is also other classes you can make your type an instance of. See > the link above. You should properly make it an instance of Widget as a > minimum. > > I also asked about something similar before. I got this reply > > http://www.mail-archive.com/wxh...@li.../msg0026= 0.html. > > > Greetings, > > Mads Lindstr=F8m > > > |