Class: Gtk::ListStore

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk4/list-store.rb

Instance Method Summary collapse

Constructor Details

#initialize(*columns) ⇒ ListStore

Returns a new instance of ListStore.



20
21
22
23
24
25
# File 'lib/gtk4/list-store.rb', line 20

def initialize(*columns)
  if columns.empty?
    raise ArgumentError, "No column type is specified"
  end
  initialize_raw(columns)
end

Instance Method Details

#appendObject



28
29
30
31
32
# File 'lib/gtk4/list-store.rb', line 28

def append
  iter = append_raw
  setup_iter(iter)
  iter
end

#append_rawObject



27
# File 'lib/gtk4/list-store.rb', line 27

alias_method :append_raw, :append

#initialize_rawObject



19
# File 'lib/gtk4/list-store.rb', line 19

alias_method :initialize_raw, :initialize

#insert(index, values = nil) ⇒ Object



42
43
44
45
46
47
# File 'lib/gtk4/list-store.rb', line 42

def insert(index, values=nil)
  iter = insert_raw(index)
  setup_iter(iter)
  set_values(iter, values) if values
  iter
end

#insert_after(index) ⇒ Object



57
58
59
60
61
# File 'lib/gtk4/list-store.rb', line 57

def insert_after(index)
  iter = insert_after_raw(index)
  setup_iter(iter)
  iter
end

#insert_after_rawObject



56
# File 'lib/gtk4/list-store.rb', line 56

alias_method :insert_after_raw, :insert_after

#insert_before(index) ⇒ Object



50
51
52
53
54
# File 'lib/gtk4/list-store.rb', line 50

def insert_before(index)
  iter = insert_before_raw(index)
  setup_iter(iter)
  iter
end

#insert_before_rawObject



49
# File 'lib/gtk4/list-store.rb', line 49

alias_method :insert_before_raw, :insert_before

#insert_rawObject



41
# File 'lib/gtk4/list-store.rb', line 41

alias_method :insert_raw, :insert

#prependObject



35
36
37
38
39
# File 'lib/gtk4/list-store.rb', line 35

def prepend
  iter = prepend_raw
  setup_iter(iter)
  iter
end

#prepend_rawObject



34
# File 'lib/gtk4/list-store.rb', line 34

alias_method :prepend_raw, :prepend

#set_column_types(*types) ⇒ Object



64
65
66
67
68
69
# File 'lib/gtk4/list-store.rb', line 64

def set_column_types(*types)
  if types.size == 1 and types[0].is_a?(Array)
    types = types[0]
  end
  set_column_types_raw(types)
end

#set_column_types_rawObject



63
# File 'lib/gtk4/list-store.rb', line 63

alias_method :set_column_types_raw, :set_column_types