Class: Gtk::TreeIter

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/gtk/tree_iter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ownerObject

Returns the value of attribute owner.



3
4
5
# File 'lib/gtk/tree_iter.rb', line 3

def owner
  @owner
end

Instance Method Details

#[](i) ⇒ Object



10
11
12
13
14
# File 'lib/gtk/tree_iter.rb', line 10

def [] i
  val = FFI::MemoryPointer.new(:float,1) # TODO: lookup column type
  owner.get(self,:int,i,:pointer,val,:int,-1)
  val.read_float
end

#[]=(i, value) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/gtk/tree_iter.rb', line 16

def []= i,value
  owner.set(self,:int,i,
    case value
    when String
      :string
    when Fixnum
      :int
    when Float
      :float
    else
      raise value.class.name
    end,
    value,:int,-1)
end