Graphics.UI.GLUT has a Dial and Button callback. I don't find any example of use of this callback. I wanted to have one because currently I use the keyboard and the mouse callbacks and this is not enough and not user-friendly.
I've tried to do one such callback. In my program:
dial :: IORef GLdouble -> DialAndButtonBoxCallback
dial zoom index =
case index of
DialAndButtonBoxDial 1 1 -> zoom $~! (+1)
_ -> return ()
Then I expect to see a button (button 1
) in the OpenGL window which would increment zoom
when I press on this button (zoom $~! (+1)
zooms the graphic, I use it in the keyboard callback currently, no problem with that).
Then in my main
file:
zoom <- newIORef 0.0
dialAndButtonBoxCallback $= Just (dial zoom)
The code compiles. But when I run the program, there's no dialog box appearing anywhere.
I would appreciate any help. Maybe I have to create a dialog box first ? I don't see anything like this in the documentation.