0

I've made several TextCtrls and Button, but currently users of my application don't want to see them. So I have to hide them temporary (for current build).
Here they are:

class MainFrame < Wx::Frame
    def initialize (parent = nil)
        super nil,:title=>"sometitle",:size=>[600,600]
        set_sizer Wx::BoxSizer.new Wx::VERTICAL

        @tag1 = Wx::TextCtrl.new self
        sizer.add_item @tag1,:flag=>Wx::RIGHT|Wx::EXPAND
        @tag1.set_value 'property'

        @tag1title = Wx::TextCtrl.new self
        sizer.add_item @tag1title,:flag=>Wx::RIGHT|Wx::EXPAND
        @tag1title.set_value 'title'

        @tag2 = Wx::TextCtrl.new self
        sizer.add_item @tag2,:flag=>Wx::RIGHT|Wx::EXPAND
        @tag2.set_value 'description'

        @tag2title = Wx::TextCtrl.new self
        sizer.add_item @tag2title,:flag=>Wx::RIGHT|Wx::EXPAND
        @tag2title.set_value ''

        @button_parse = Wx::Button.new self
        sizer.add_item @button_parse
        @button_parse.label = "Parse XML"
        evt_button @button_parse, :click_parse

        # ......
    end
    # ......
end

I see nothing about it in docs and Google is also not a friend for me today.

Nakilon
  • 34,866
  • 14
  • 107
  • 142
  • Are they in a sizer? If so, it looks like you could use `Sizer#show` http://wxruby.rubyforge.org/doc/sizer.html#Sizer_show – Paul Hoffer Dec 30 '10 at 18:37
  • @phoffer, yes, it's just want I need! `sizer.show @tag1,false` - You may rewrite comment as answer to make me possible to accept it. – Nakilon Dec 30 '10 at 19:38

1 Answers1

1

Since they are in a sizer, then you'll be able to use Sizer#show.

Boolean show(Sizer sizer,  
         Boolean show = false, 
         Boolean recursive = false)

This works for BoxSizer and FlexGridSizer.

Paul Hoffer
  • 12,606
  • 6
  • 28
  • 37