Method: VMAgui#monitor

Defined in:
lib/vimamsa/gui.rb

#monitorObject



662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/vimamsa/gui.rb', line 662

def monitor
  swa = @windows[1][:sw]
  @monitor_time ||= Time.now
  @sw_width ||= swa.width
  return true if Time.now - @monitor_time < 0.2
  # Detect element resize
  if swa.width != @sw_width
    # puts "@sw.width=#{@sw.width}"
    @sw_width = swa.width
    DelayExecutioner.exec(id: :scale_images, wait: 0.7, callable: proc { vma.gui.scale_all_images })
  end
  @monitor_time = Time.now
  return true
end