Is this just something that hasn’t been added because people don’t
manipulate wxSizerItems much, or is it something deeper than that? Or
am I
doing something stupid?
The reason this comes up is that I am trying to use spacers in a dynamic
way, “collapsing” them with show(false) when needed.
Actually, the best thing to do, is for you to use the Root Sizer, EG:
BoxSizer, FlexGridSizer, Etc, etc, to utilize the #layout() method, to
update the controls being displayed, and utilize the Window#show()
method on
the actual control, instead of the sizer item.
An example would be:
def on_click_hide() @my_control.show(false)
self.sizer.layout()
end
This will cause the control to be hidden, and to call layout() to
re-size
all of the children controls that have been added to the Sizer.
Actually, the best thing to do, is for you to use the Root Sizer, EG:
BoxSizer, FlexGridSizer, Etc, etc, to utilize the #layout() method, to
update the controls being displayed, and utilize the Window#show() method on
the actual control, instead of the sizer item.
Mario,
If I am using the add() method on the sizer which adds a spacer, is
there a
control at all?
I don’t believe there is an actual control returned from #add() method
that
is utitlized to add a spacer. It is more then nothing an internal data
structure in which to show that something occupies that space, but
nothing
is actually drawn for that space itself. If you need to dynamically
add/remove spacers, I would suggest utilizing #remove() to remove it.
wxSizerItem is not employed within wxRuby, as it’s of more use
internally,
then externally.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.