Class: WxIRB::BaseFrame

Inherits:
Wx::Frame
  • Object
show all
Defined in:
lib/wxirb.rb

Overview

Parent and top-level window for all the wxirb controls.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, opts = {}) ⇒ BaseFrame

Returns a new instance of BaseFrame.



371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/wxirb.rb', line 371

def initialize(parent, opts={})
  bind = (opts.delete(:binding) || binding)
  @mirb=MimickIRB.new(bind)

  opts[:title] ||= "WxIRB"
  super(parent, opts)

  @splitter = TerminalSplitter.new(self)
  @output = OutputTextCtrl.new(@splitter)
  @input = InputTextCtrl.new(@splitter, @output, @mirb)
  @splitter.split_horizontally(@output, @input)
  @input.set_focus()
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



369
370
371
# File 'lib/wxirb.rb', line 369

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



369
370
371
# File 'lib/wxirb.rb', line 369

def output
  @output
end

Instance Method Details

#clearObject

Clears the output window



391
# File 'lib/wxirb.rb', line 391

def clear; @output.clear ; end

#histdump(s = 0, e = -1)) ⇒ Object

Prints the history to the output text area. Takes optional start and end position indexes for viewing just a slice of the history array.



398
399
400
# File 'lib/wxirb.rb', line 398

def histdump(s=0, e=-1)
  puts self.history[s..e]
end

#historyObject

Returns the window’s command history object (see WxIRB::CommandHistory)



394
# File 'lib/wxirb.rb', line 394

def history; @input.history ; end

#set_binding(bind) ⇒ Object Also known as: cb, change_binding

Allow our binding to be changed on the fly



386
# File 'lib/wxirb.rb', line 386

def set_binding(bind);  @mirb.set_binding(bind); end