Class: Rediscover::Frame::Main
- Inherits:
-
Wx::Frame
- Object
- Wx::Frame
- Rediscover::Frame::Main
- Includes:
- Wx
- Defined in:
- lib/rediscover/frame/main.rb
Constant Summary collapse
- WINDOW_WIDTH =
600
- WINDOW_HEIGHT =
400
Instance Method Summary collapse
-
#initialize ⇒ Main
constructor
A new instance of Main.
- #setup_notebook ⇒ Object
- #setup_status_bar ⇒ Object
- #update_status_bar(status = nil) ⇒ Object
Constructor Details
#initialize ⇒ Main
Returns a new instance of Main.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rediscover/frame/main.rb', line 9 def initialize super(nil, -1, 'Rediscover', DEFAULT_POSITION, Size.new(WINDOW_WIDTH, WINDOW_HEIGHT)) @redis = get_app.redis @logger = get_app.logger set_icon(Rediscover::Icon.new('application')) setup_notebook show end |
Instance Method Details
#setup_notebook ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rediscover/frame/main.rb', line 22 def setup_notebook @notebook = Notebook.new(self) @server_page = Panel::Server.new(@notebook) @browser_page = Panel::Browser.new(@notebook) @browser_page.on_status_change { |status| (status) } @notebook.add_page(@server_page, 'Server Info', false) @notebook.add_page(@browser_page, 'Key Browser', true) end |
#setup_status_bar ⇒ Object
33 34 35 36 37 |
# File 'lib/rediscover/frame/main.rb', line 33 def @status_bar = (2) @status_bar.set_status_widths([-3, -1]) # set fields to variable widths end |
#update_status_bar(status = nil) ⇒ Object
39 40 41 42 |
# File 'lib/rediscover/frame/main.rb', line 39 def (status = nil) @status_bar.set_status_text(@redis.to_s, 0) # connection info in left field @status_bar.set_status_text(status, 1) if status # key count in right field end |