Class: WindowManager
- Inherits:
-
Object
- Object
- WindowManager
- Defined in:
- lib/windowmanager.rb
Overview
Monkeypatch event handlers for dynamic fill-in
Instance Method Summary collapse
-
#initialize ⇒ WindowManager
constructor
A new instance of WindowManager.
- #on_destroynotify_do(&block) ⇒ Object
- #on_maprequest_do(&block) ⇒ Object
- #on_motionnotify_do(&block) ⇒ Object
Constructor Details
#initialize ⇒ WindowManager
Returns a new instance of WindowManager.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/windowmanager.rb', line 9 def initialize events = Thread.new do loop do if self.event_pending? self.query eval("@"+self.next_event.downcase).call self.event_pop puts "Again..." end sleep 0.1 end end end |
Instance Method Details
#on_destroynotify_do(&block) ⇒ Object
44 45 46 |
# File 'lib/windowmanager.rb', line 44 def on_destroynotify_do(&block) @destroynotify = block end |
#on_maprequest_do(&block) ⇒ Object
40 41 42 |
# File 'lib/windowmanager.rb', line 40 def on_maprequest_do(&block) @maprequest = block end |
#on_motionnotify_do(&block) ⇒ Object
48 49 50 |
# File 'lib/windowmanager.rb', line 48 def on_motionnotify_do(&block) @motionnotify = block end |