From: Henning T. <le...@he...> - 2011-12-08 13:23:43
|
On Wed, 7 Dec 2011, David Virebayre wrote: > 2011/12/6 Henning Thielemann <le...@he...> > > I have a textCtrl 'editor' and a menu item 'editorVisible' that controls > the visibility of the textCtrl. > > set editorVisible > [ on command := do > b <- get editorVisible checked > set editor [ visible := b ] ] > > > I had the same problem, and I couldn't solve it the way I wanted. > It's old but I think I read that I shouldn't use visible for this, but remove the > element from the layout and re-set the modified layout. I got it working by adding 'windowReFit editor' or 'windowReLayout frame' after 'set editor [ visible := b ]'. I do not know, whether this is intended behaviour or an ugly hack. The official example controls.cpp uses a BoxSizer object and its Show method. I am uncertain how to translate this to wxhaskell. How do I create a BoxSizer object? With boxSizerCreate or sizerFromLayout? How do I add the BoxSizer object? By converting it to a Layout using 'sizer'? I think the best place for documenting the solution is not the FAQ but the documentation of the Visible class. |