Method: Gtk.main_with_queue

Defined in:
lib/baffle/gtk_queue.rb

.main_with_queue(timeout = 100) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/baffle/gtk_queue.rb', line 17

def Gtk.main_with_queue(timeout=100)
  Gtk.timeout_add(timeout) do
    GTK_PENDING_BLOCKS_LOCK.synchronize do
      GTK_PENDING_BLOCKS.each { |block| block.call }
      GTK_PENDING_BLOCKS.clear
    end
    
    true
  end
  
  Gtk.main
end