Bugs in Graphics.HGL.Window and its documentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bugs in Graphics.HGL.Window and its documentation

ksvanhorn
The function openWindowEx seems to ignore its second argument  
(optional initial position of window).  Here is the test program to  
illustrate this, which I ran on Mac OS X (Tiger), using hugs:

--- begin program ---

import Graphics.HGL

main = runGraphics $ do
         win <- openWindowEx "Test" (Just (200, 300)) (300, 300)
                 Unbuffered Nothing
         ((x,y), (w,h)) <- getWindowRect win
         setGraphic win (text (100,100) (show (x,y) ++ " " ++ show (w,h)))
         getKey win
         closeWindow win

--- end program ---

Also, the documentation for the type RedrawMode (http://
www.haskell.org/ghc/docs/latest/html/libraries/HGL/Graphics-HGL-
Window.html) seems to have the constructors Buffered and Unbuffered  
reversed.

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Bugs in Graphics.HGL.Window and its documentation

Duncan Coutts
On Sat, 2005-12-10 at 10:19 -0700, Kevin Van Horn wrote:
> The function openWindowEx seems to ignore its second argument  
> (optional initial position of window).  Here is the test program to  
> illustrate this, which I ran on Mac OS X (Tiger), using hugs:

Placing a window in a particular initial position on X11 (which is what
HGL on OSX uses) can only ever be best effort. The window manager is
free to ignore any initial placement hint that a window asks for. Some
window managers respect it others do not. There's nothing you can do
(except change or patch your window manager)

Duncan

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Bugs in Graphics.HGL.Window and its documentation

Glynn Clements

Duncan Coutts wrote:

> > The function openWindowEx seems to ignore its second argument  
> > (optional initial position of window).  Here is the test program to  
> > illustrate this, which I ran on Mac OS X (Tiger), using hugs:
>
> Placing a window in a particular initial position on X11 (which is what
> HGL on OSX uses) can only ever be best effort. The window manager is
> free to ignore any initial placement hint that a window asks for. Some
> window managers respect it others do not. There's nothing you can do
> (except change or patch your window manager)

However, in the case of HGL, it could request that the window manager
place the window at a specific location using XSetWMNormalHints(). It
doesn't do this at present.

--
Glynn Clements <[hidden email]>
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries