Method: Tk::Itk::Component#initialize

Defined in:
lib/tkextlib/itk/incr_tk.rb

#initialize(master, component) ⇒ Component

Returns a new instance of Component.



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/tkextlib/itk/incr_tk.rb', line 206

def initialize(master, component)
  @master = master
  @component = component

  ComponentID_TBL.mutex.synchronize{
    ComponentID_TBL[@master][@component] = self
  }

  begin
    @widget = window(tk_call(@master, 'component', @component))
    @path = @widget.path
  rescue
    @widget = nil
    @path = nil
  end
end