开发者

How to make a control invisible?

开发者 https://www.devze.com 2023-02-02 07:24 出处:网络
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).

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 toda开发者_运维知识库y.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消