class Interphase::SimpleListView

A simple list view which displays an Array.

Attributes

items[R]

Public Class Methods

new(items = [], **options, &block) click to toggle source
Calls superclass method Interphase::ListView::new
# File lib/interphase/widgets/simple_list_view.rb, line 11
def initialize(items = [], **options, &block)
  super(['Column'], options, &block)

  gtk_instance.headers_visible = false

  @items = Interphase::Helpers::Observable.new(items) do
    refresh_items
  end

  refresh_items
end

Public Instance Methods

refresh_items() click to toggle source

Copies items into rows, where each item is one row.

# File lib/interphase/widgets/simple_list_view.rb, line 24
def refresh_items
  items.each do |item|
    rows << [item]
  end
end