|
From: Daniel F. <daf...@st...> - 2004-10-22 22:24:01
|
Hello!
I have a strange problem when using splitter windows with a spin
control inside. I reduced my problem to the sample code below. When I
running it on Windows I'm unable to resize the top left area by moving
the vertical splitter bar left or right. But the horizontal splitter
bar works fine. It seems to be a problem with the spin control. When
replacing the spin control by a simple text entry (changing the line
"spin <- spinCtrl panelLeft 0 100 []" to "spin <- textEntry panelLeft []")
both splitter bars work fine. Strangly this problem does not occur
when running it on Linux.
Is it my fault or is there a bug in wxHaskell or in wxWidgets?
I'm using Windows XP prof SP2, ghc 6.2.1 and wxHaskell 0.8.
And just another related question: how can I make the splitter windows
respect the minimum size needed for the controls in the splitter
panes?
Many thanks in advance for your help
Daniel Fischer
---8<---------- sample code ----------8<---
module Main where
import Graphics.UI.WX
import Graphics.UI.WXCore
main :: IO ()
main
= start gui
gui :: IO ()
gui
= do f <- frame [ text := "error?" ]
hSplit <- splitterWindow f [ style := wxSP_3DSASH ]
vSplit <- splitterWindow hSplit [ style := wxSP_3DSASH ]
panelLeft <- panel vSplit []
spin <- spinCtrl panelLeft 0 100 []
entry <- textEntry panelLeft []
btn1 <- button panelLeft [ text := "Ok" ]
btn2 <- button panelLeft [ text := "Ok" ]
list1 <- listCtrl panelLeft [ columns := [("foo",AlignLeft,100)] ]
list2 <- listCtrl vSplit [ columns := [("bar",AlignLeft,100)] ]
list3 <- listCtrl hSplit [ columns := [("baz",AlignLeft,100)] ]
subLayoutLeft <- return $ vfill $ column 5
[ boxed "box 1" $ row 5 [ fill $ widget spin, widget btn1 ]
, boxed "box 2" $ row 5 [ fill $ widget entry, widget btn2 ]
]
layoutLeft <- return $ fill $ row 5 [ fill $ widget list1, subLayoutLeft ]
set panelLeft [ layout := layoutLeft ]
layoutTop <- return $ vsplit vSplit 5 300 (widget panelLeft) (widget list2)
layoutAll <- return $ hsplit hSplit 5 300 layoutTop (widget list3)
set f [ layout := minsize (sz 640 400) $ fill layoutAll ]
|