hi
On 22/09/2012 16:39, Daniel S. wrote:> My Code:
>
> @sizer = VBoxSizer.new
> @sizer.add_item(StaticText.new(self, -1, "Test"), flag:
ALIGN_CENTRE)
>
>
> Until here, everything is OK, Text appears on screen at the right place.
>
> Now i want to remove this Text and replace it with two others. For this
> do the following:
>
> @sizer.remove(0)
> @sizer.layout()
> @sizer.add_item(StaticText.new(self, -1, "Min"), flag:
ALIGN_CENTRE)
> @sizer.add_item(StaticText.new(self, -1, "Max"), flag:
ALIGN_CENTRE)
>
>
I haven''t tried, but - you might try calling destroy() on the
StaticText
you''re deleting. In wxRuby you don''t usually need to call this
but here
it might be appropriate:
http://wxruby.rubyforge.org/doc/window.html#Window_destroy
And usually, layout() is called after you have finished doing all
changes to the contents of a Sizer.
alex