module Gtk
Constants
- GTK_PENDING_BLOCKS
- GTK_PENDING_BLOCKS_LOCK
Public Class Methods
get_style_file_contents(path, filename)
click to toggle source
# File lib/rugui/framework_adapters/GTK.rb, line 68 def Gtk.get_style_file_contents(path, filename) IO.read(File.join(path, filename)).gsub('{ROOT_PATH}', RuGUI.configuration.root_path.to_s) end
is_style_file?(path, filename)
click to toggle source
# File lib/rugui/framework_adapters/GTK.rb, line 64 def Gtk.is_style_file?(path, filename) File.extname(filename) == '.rc' or /gtkrc/.match(filename) if File.file?(File.join(path, filename)) end
load_style_paths()
click to toggle source
# File lib/rugui/framework_adapters/GTK.rb, line 55 def Gtk.load_style_paths styles_paths = RuGUI.configuration.styles_paths.select { |path| File.directory?(path) } styles_paths.each do |path| Dir.new(path).each do |entry| Gtk::RC.parse_string(get_style_file_contents(path, entry)) if is_style_file?(path, entry) end end end
queue(&block)
click to toggle source
# File lib/rugui/framework_adapters/GTK.rb, line 32 def Gtk.queue(&block) if Thread.current == Thread.main block.call else GTK_PENDING_BLOCKS_LOCK.synchronize do GTK_PENDING_BLOCKS << block end end end
queue_timeout(timeout)
click to toggle source
Adds a timeout to execute pending blocks in a queue.
# File lib/rugui/framework_adapters/GTK.rb, line 43 def Gtk.queue_timeout(timeout) Gtk.timeout_add timeout do GTK_PENDING_BLOCKS_LOCK.synchronize do GTK_PENDING_BLOCKS.each do |block| block.call end GTK_PENDING_BLOCKS.clear end true end end