module RUI
Constants
- MainWindow
Public Class Methods
active_color()
click to toggle source
# File lib/rui/toolkits/kde/kde.rb, line 263 def self.active_color scheme = KDE::ColorScheme.new(Qt::Palette::Active, KDE::ColorScheme::Window) color = scheme.foreground(KDE::ColorScheme::PositiveText).color end
autogui(name = :gui, opts = { }, &blk)
click to toggle source
Create a GUI descriptor using the descriptor DSL.
A GUI descriptor, as returned by this function, can be applied to a Widget by settings the widget’s gui property to it. For example:
widget.gui = RUI::autogui do button(:text => "Hello world") end
See {Descriptor} for more details on the general descriptor DSL.
See {RUI::GuiBuilder} for a list of supported descriptor tags for GUI descriptors.
# File lib/rui.rb, line 51 def self.autogui(name = :gui, opts = { }, &blk) Descriptor.build(:gui, opts.merge(:gui_name => name), &blk) end
const_missing(c)
click to toggle source
# File lib/rui.rb, line 25 def self.const_missing(c) if KDE.const_defined?(c) KDE.const_get(c) else Qt.const_get(c) end end
gui(name, &blk)
click to toggle source
# File lib/rui/toolkits/kde/kde.rb, line 198 def self.gui(name, &blk) "<!DOCTYPE kpartgui SYSTEM \"kpartgui.dtd\">\n" + XmlGuiBuilder.new.gui({ :version => 2, :name => name }, &blk) end
i18n(*args)
click to toggle source
# File lib/rui/toolkits/kde/kde.rb, line 273 def self.i18n(*args) KDE.i18n(*args) end
std_shortcut(name)
click to toggle source
# File lib/rui/toolkits/kde/kde.rb, line 268 def self.std_shortcut(name) code = KDE::StandardShortcut.send(name.to_s.capitalize) StandardShortcut::shortcut(code) end
with_xml_gui(xml, &blk)
click to toggle source
# File lib/rui/toolkits/kde/kde.rb, line 203 def self.with_xml_gui(xml, &blk) tmp = TemporaryFile.new tmp.open ::File.open(tmp.file_name, 'w') do |f| f.write(xml) end blk[tmp.file_name] ensure tmp.close ::File.unlink(tmp.file_name) end