From: Jason Persampieri Date: 2002-12-12T03:58:33+09:00 Subject: Re: FXRuby : Setting Default Height/Width in an FXList > Generally speaking, containers *do* re-evaluate > their width and height > when a child widget is added or removed (... or > hidden or shown, etc.) > If this doesn't seem to be happening you can force a > widget to > recalculate its layout by calling recalc(), e.g. > > FXLabel.new(aContainer, "myLabel") > FXTextField(aContainer, 6) > aContainer.recalc > > but as I said this usually isn't necessary. > ok... try this... it shows what I'm talking about. When the FXText's are deleted, the scrollbar doesn't change. require 'fox' include Fox class MyMainWindow < FXMainWindow def initialize(app) super(app, "Delete Children Test", nil, nil, DECOR_ALL, 0, 0, 200, 100) #layout screen button = FXButton.new(self, "Push me.") scrollFrame = FXScrollWindow.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) @frame = FXVerticalFrame.new(scrollFrame, FRAME_SUNKEN) FXText.new(@frame) FXText.new(@frame) FXText.new(@frame) FXText.new(@frame) FXText.new(@frame) FXText.new(@frame) button.connect(SEL_COMMAND, method(:onButton)) end def create super show(PLACEMENT_SCREEN) end def onButton(sender, sel, item) 0.upto(@frame.numChildren-1) do |childNum| @frame.childAtIndex(childNum).destroy end @frame.recalc end end theApp = FXApp.new("Foo") theApp.init(ARGV) myWindow = MyMainWindow.new(theApp) theApp.create theApp.run