[fxruby-users] Dynamically removing & adding widgets at runtime

Assaph Mehr assaph at gmail.com
Fri May 19 02:43:02 EDT 2006


> Am facing a problem where I dynamically remove and add widgets at
> runtime, but the new widgets are not drawn. Attached is a simple
> reproduction script.

Seems like a generic problem with adding widgets. Here is a simpler
reproduction:


require 'fox14'
include Fox

class ControllerWindow < FXMainWindow

  def initialize(app)
    super(app, "Test", nil, nil, DECOR_ALL, 500, 300)
    @reload_btn = FXButton.new(self, "Add")
    @reload_btn.connect(SEL_COMMAND) do
      l = FXLabel.new(self, "Aa")
      self.title = self.numChildren.to_s
      resize(getDefaultWidth(), getDefaultHeight())
    end
  end
end

obj_controller_app = FXApp.new
obj_controller_window = ControllerWindow.new(obj_controller_app)
obj_controller_app.create
obj_controller_window.show
obj_controller_app.run


Using FXRuby 1.4.6.

Thanks,
Assaph



More information about the fxruby-users mailing list