divide the display in subwindows

<[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <Pine.A41.3.96.1030120221836.21224B-100000@studserv.uni-leipzig.de>
Hi there.

I want to divide my window into subwindows to display different
informations (like Nate Robins in his OpenGL Tutorials, if anyone knows).
So I try to work out his solution in Haskell. My Main.hs has the following
structure:

main :: ...

 mainWin<-createWindow..

 reshapeFunc (Just mainReshape)
 displayF... mainDisplay

 sub1<-createSubWindow mainWin ...

 reshapeFunc (Just sub1Reshape)
 ...


-- here follows the interesting part
-- in the mainReshape Nate Robins call the subReshapes...

mainReshape :: ReshapeAction
...
...
 setWindow sub1  --!!! no sub1-Window in there :-(
 positionWindow (...)
 reshapeWindow (...)


-----------------------------------------------------------------


its clear that sub1 isnt known in the mainReshape. In C you can define
global variables to solve this. Is that in Haskell possible too?
I can't give the sub1 Window directly to the mainReshape 
(mainReshape :: Window -> Resh..) because when the funtion is called in
the main this sub1 isnt created yet (see above). 

I hope this was a clear description of the dilemma I'm in. And I pray,
that I'm just too stupid and the solution is much more clearer to you.

Thanx a lot
Patrick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.