Class: Gtk::StyleContext

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk3/style-context.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_provider_for_screen(screen, provider, priority = nil) ⇒ Object


30
31
32
33
# File 'lib/gtk3/style-context.rb', line 30

def add_provider_for_screen(screen, provider, priority=nil)
  priority = resolve_priority(priority)
  add_provider_for_screen_raw(screen, provider, priority)
end

.add_provider_for_screen_rawObject


29
# File 'lib/gtk3/style-context.rb', line 29

alias_method :add_provider_for_screen_raw, :add_provider_for_screen

.reset_widgets(screen = nil) ⇒ Object


36
37
38
# File 'lib/gtk3/style-context.rb', line 36

def reset_widgets(screen=nil)
  reset_widgets_raw(screen || Gdk::Screen.default)
end

.reset_widgets_rawObject


35
# File 'lib/gtk3/style-context.rb', line 35

alias_method :reset_widgets_raw, :reset_widgets

.resolve_priority(priority) ⇒ Object


20
21
22
23
24
25
26
27
# File 'lib/gtk3/style-context.rb', line 20

def resolve_priority(priority)
  case priority
  when Symbol, String
    StyleProvider.const_get("PRIORITY_#{priority.to_s.upcase}")
  else
    priority || StyleProvider::PRIORITY_APPLICATION
  end
end

Instance Method Details

#add_provider(provider, priority = nil) ⇒ Object


42
43
44
45
# File 'lib/gtk3/style-context.rb', line 42

def add_provider(provider, priority=nil)
  priority = self.class.resolve_priority(priority)
  add_provider_raw(provider, priority)
end

#add_provider_rawObject


41
# File 'lib/gtk3/style-context.rb', line 41

alias_method :add_provider_raw, :add_provider