Class: AGTkPackManager

Inherits:
Object
  • Object
show all
Defined in:
ext/ae-rad/lib/tk/al-tk.rb

Instance Method Summary collapse

Constructor Details

#initialize(_agobj, _active) ⇒ AGTkPackManager

Returns a new instance of AGTkPackManager.


562
563
564
565
566
567
568
569
570
571
572
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 562

def initialize(_agobj, _active)
  unless defined? _agobj.ag_parent
    return
  end
  @agobj = _agobj
  if !defined? @@packs_managers
    @@packs_managers = Array.new
  end
  activate if _active
  @@packs_managers << self
end

Instance Method Details

#activateObject


578
579
580
581
582
583
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 578

def activate
  @@packs_managers.each do |value|
    value.free_rect
  end
  create_rect
end

#create_rectObject


585
586
587
588
589
590
591
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 585

def create_rect
  # r1         r14       r4
  # r12                  r34
  # r2         r23       r3
  TkPack::propagate(@agobj.obj, false)
  @r1 = AGTkObjPackRect.new(@agobj.obj, 3,  3, 'nw')
end

#deactivateObject


574
575
576
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 574

def deactivate
  self.free_rect
end

#free_rectObject


593
594
595
596
597
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 593

def free_rect
  if defined? @r1
    @r1.r.destroy
  end
end