From: Henk-Jan v. T. <hj...@ch...> - 2010-01-23 21:41:20
|
On Sat, 23 Jan 2010 17:33:33 +0100, Günther Schmidt <gue...@we...> wrote: > Hi, > > I'd like to be able to "fold" away a widget on button click. I manage to > make it disappear but the space it used to occupy is still occupied. > > How can I "fold" it away? Like in a Tree View? > > Günther You could do it the like this (if you press the button "Remove me", its place will be taken by button "Close"): > import Graphics.UI.WX > main :: IO () > main = start $ > do > f <- frame [ fontSize := 18 > , clientSize := sz 200 200 ] > > ok0 <- button f [ on command := close f > , text := "Close" ] > ok1 <- button f [ text := "Remove me" ] > > set ok1 [ on command := do set ok1 [ > visible := False ] > set f [ layout := column 1 [ widget ok0 ] ] > ] > > set f [ layout := column 1 [ widget ok1 > , widget ok0 > ] > ] > > return () Met vriendelijke groet, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html -- |