Method: Tk::TreeCtrl::Style#initialize

Defined in:
ext/lib/tkextlib/treectrl/tktreectrl.rb

#initialize(parent, keys = nil) ⇒ Style

Returns a new instance of Style.



2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
# File 'ext/lib/tkextlib/treectrl/tktreectrl.rb', line 2245

def initialize(parent, keys=nil)
  @tree = parent
  @tpath = parent.path

  Tk::TreeCtrl::Style::TreeCtrlStyleID.mutex.synchronize{
    @path = @id = 
      Tk::TreeCtrl::Style::TreeCtrlStyleID.join(TkCore::INTERP._ip_id_)
    Tk::TreeCtrl::Style::TreeCtrlStyleID[1].succ!
  }

  Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
    Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {} 
    Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath][@id] = self
  }

  @tree.style_create(@id, keys)
end