#1898 Changing FWT Window Content

SlimerDude Wed 30 May 2012

In FWT is it possible to change the content pane of a window at will?

window := Window()
window.content = BlueCanvas()
...
window.content = RedCanvas()

I'm using the Java / SWT impl and don't seem to able to get the second Canvas to redraw / paint.

Cheers.

KevinKelley Wed 30 May 2012

yes, should work. need to relayout after; I usually walk up the parent tree with relayout at each level, to be sure.

for (widget:=parent; widget!=null; widget=widget.parent) {
  widget.relayout
}

(edit: accidental send)

SlimerDude Wed 30 May 2012

Thanks, it was actually my oversight in the end. My code is more like:

window := Window()
window.open
window.content = BlueCanvas()
...
window.content = RedCanvas()

And window.open blocks until closed! So my canvas's weren't being set until after I closed the window. D'Oh!

Need to fire off another Actor to manipulate the Window.

Cheers.

brian Wed 30 May 2012

Login or Signup to reply.