1

I have a little program in haskell, using wxhaskell. It displays a window with a panel inside, containing some drawings. The problem is that the window shrinks to a very tiny size, and I have to expand it with the mouse.

How can I define correctly the size?

here is my program:

module Main where
import Graphics.UI.WX
import Graphics.UI.WXCore

main :: IO ()
main
  = start hello

hello :: IO ()
hello = do 
        f    <- frame    [text := "HELLO!"]
        sw <- panel f [ on paint := onpaint]
        set f   [clientSize  := sz 300 300,
                layout := fill $ widget sw]
        return()

    where 
        onpaint dc pnel = do 
            circle dc (pt 200 200) 20 [penKind := PenDash DashDot]
            drawPoint dc (pt 200 200) []

thank you.

lolveley
  • 1,659
  • 2
  • 18
  • 34

1 Answers1

1

Setting a minimum size instead of the client size

set f [ layout := minsize (sz 300 300) $ widget sw ]

works for me.

Heinrich Apfelmus
  • 11,034
  • 1
  • 39
  • 67