|
From: <wxh...@al...> - 2004-05-17 16:07:05
|
> If that doesn't work, maybe you should download the sources of GeBoB (see
> application screenshots for a link). He uses a tree control for the
> "brain"
> component and maybe it gives some more info on using tree controls.
The solution was not related to treeCtrl at all, but did come from
looking at GeBoB. One should always "fill" the containing widget.
Here is the updated, working code (with 6 additional characters):
module Main where
import Graphics.UI.WX
import Graphics.UI.WXCore
imageNone :: Int
imageNone = (-1)
main :: IO()
main = start test
test :: IO()
test = do f <- frame [text := "Hello!"]
tree <- treeCtrl f []
top <- treeCtrlAddRoot tree "Root" imageNone imageNone
objectNull
item <- treeCtrlAppendItem tree top "Child" imageNone imageNone
objectNull
set f [layout := fill $ widget tree, clientSize := sz 500 300]
|