Method: Tk::TreeCtrl::Style#initialize

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

#initialize(parent, keys = nil) ⇒ Style

Returns a new instance of Style.



2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
# File 'lib/tkextlib/treectrl/tktreectrl.rb', line 2304

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