Class: WxSugar::EnumerableControl::StringsCollection

Inherits:
ItemCollection show all
Defined in:
lib/wx_sugar/enumerable_controls.rb

Overview

A proxy class for classes that use get/set_string to set labels, inheriting from ControlWithItems.

Instance Attribute Summary

Attributes inherited from ItemCollection

#cwi

Instance Method Summary collapse

Methods inherited from ItemCollection

#index?, #initialize

Constructor Details

This class inherits a constructor from WxSugar::EnumerableControl::ItemCollection

Instance Method Details

#[](i) ⇒ Object

Retrieves the string for item i



132
133
134
# File 'lib/wx_sugar/enumerable_controls.rb', line 132

def [](i)
  super :get_string, i
end

#[]=(i, str) ⇒ Object

Sets a string within the control



137
138
139
# File 'lib/wx_sugar/enumerable_controls.rb', line 137

def []=(i, str)
  super :set_string, i, str
end

#eachObject



127
128
129
# File 'lib/wx_sugar/enumerable_controls.rb', line 127

def each 
  cwi.each { | i | yield cwi.get_string(i) }
end