Module: TkPalette (Ruby 2.3.4)

In Files

  • tk/lib/tk/palette.rb

Class/Module Index [+]

Quicksearch

TkPalette

Constants

TkCommandNames

Public Class Methods

bisque()
 
               # File tk/lib/tk/palette.rb, line 26
def TkPalette.bisque
  tk_call('tk_bisque')
end
            
darken(color, percent)
 
               # File tk/lib/tk/palette.rb, line 30
def TkPalette.darken(color, percent)
  tk_call('tkDarken', color, percent)
end
            
recolorTree(win, colors)
 
               # File tk/lib/tk/palette.rb, line 34
def TkPalette.recolorTree(win, colors)
  if not colors.kind_of?(Hash)
    fail "2nd arg need to be Hash"
  end

  tk_call('global', "tkPalette")
  colors.each{|key, value|
    begin
      if win.cget(key) == tk_call('set', "tkPalette(#{key})")
        win[key] = colors[key]
      end
    rescue
      # ignore
    end
  }

  TkWinfo.children(win).each{|w| TkPalette.recolorTree(w, colors)}
end
            
set(*args)
 
               # File tk/lib/tk/palette.rb, line 18
def TkPalette.set(*args)
  args = args[0].to_a.flatten if args[0].kind_of? Hash
  tk_call('tk_setPalette', *args)
end
            
setPalette(*args)
 
               # File tk/lib/tk/palette.rb, line 22
def TkPalette.setPalette(*args)
  TkPalette.set(*args)
end
            

Public Instance Methods

recolorTree(colors)
 
               # File tk/lib/tk/palette.rb, line 53
def recolorTree(colors)
  TkPalette.recolorTree(self, colors)
end