Class: Test::Unit::UI::GTK2::FaultList

Inherits:
Gtk::TreeView
  • Object
show all
Defined in:
lib/test/unit/ui/gtk2/testrunner.rb

Instance Method Summary collapse

Constructor Details

#initializeFaultList

Returns a new instance of FaultList.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 25

def initialize
  @faults = []
  @model = Gtk::ListStore.new(String, String)
  super(@model)
  column = Gtk::TreeViewColumn.new
  column.visible = false
  append_column(column)
  renderer = Gtk::CellRendererText.new
  column = Gtk::TreeViewColumn.new("Failures", renderer, {:text => 1})
  append_column(column)
  selection.mode = Gtk::SELECTION_SINGLE
  set_rules_hint(true)
  set_headers_visible(false)
end

Instance Method Details

#add_fault(fault) ⇒ Object

def initialize



40
41
42
43
44
45
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 40

def add_fault(fault)
  @faults.push(fault)
  iter = @model.append
  iter.set_value(0, (@faults.length - 1).to_s)
  iter.set_value(1, fault.short_display)
end

#clearObject

def get_fault



51
52
53
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 51

def clear
  model.clear
end

#get_fault(iter) ⇒ Object

def add_fault(fault)



47
48
49
# File 'lib/test/unit/ui/gtk2/testrunner.rb', line 47

def get_fault(iter)
  @faults[iter.get_value(0).to_i]
end