Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

  • tk/lib/tk/xim.rb

Class/Module Index [+]

Quicksearch

TkXIM

Constants

TkCommandNames

Public Class Methods

caret(win, keys=nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 34
def TkXIM.caret(win, keys=nil)
  if keys
    tk_call_without_enc('tk', 'caret', win, *hash_kv(keys))
    self
  else
    lst = tk_split_list(tk_call_without_enc('tk', 'caret', win))
    info = {}
    while key = lst.shift
      info[key[1..-1]] = lst.shift
    end
    info
  end
end
            
configinfo(win, slot=nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 61
def TkXIM.configinfo(win, slot=nil)
  if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
    begin
      if /^8\.*/ === Tk::TK_VERSION  && JAPANIZED_TK
        if slot
          conf = tk_split_list(tk_call('imconfigure', win, "-#{slot}"))
          conf[0] = conf[0][1..-1]
          conf
        else
          tk_split_list(tk_call('imconfigure', win)).collect{|conf|
            conf[0] = conf[0][1..-1]
            conf
          }
        end
      else
        []
      end
    rescue
      []
    end
  else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
    TkXIM.current_configinfo(win, slot)
  end
end
            
configure(win, slot, value=None) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 48
def TkXIM.configure(win, slot, value=None)
  begin
    if /^8\.*/ === Tk::TK_VERSION  && JAPANIZED_TK
      if slot.kind_of? Hash
        tk_call('imconfigure', win, *hash_kv(slot))
      else
        tk_call('imconfigure', win, "-#{slot}", value)
      end
    end
  rescue
  end
end
            
current_configinfo(win, slot=nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 86
def TkXIM.current_configinfo(win, slot=nil)
  begin
    if /^8\.*/ === Tk::TK_VERSION  && JAPANIZED_TK
      if slot
        conf = tk_split_list(tk_call('imconfigure', win, "-#{slot}"))
        { conf[0][1..-1] => conf[1] }
      else
        ret = {}
        tk_split_list(tk_call('imconfigure', win)).each{|conf|
          ret[conf[0][1..-1]] = conf[1]
        }
        ret
      end
    else
      {}
    end
  rescue
    {}
  end
end
            
useinputmethods(value = None, win = nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 12
def TkXIM.useinputmethods(value = None, win = nil)
  if value == None
    if win
      bool(tk_call_without_enc('tk', 'useinputmethods',
                               '-displayof', win))
    else
      bool(tk_call_without_enc('tk', 'useinputmethods'))
    end
  else
    if win
      bool(tk_call_without_enc('tk', 'useinputmethods',
                               '-displayof', win, value))
    else
      bool(tk_call_without_enc('tk', 'useinputmethods', value))
    end
  end
end
            
useinputmethods_displayof(win, value = None) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 30
def TkXIM.useinputmethods_displayof(win, value = None)
  TkXIM.useinputmethods(value, win)
end
            

Public Instance Methods

caret(keys=nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 111
def caret(keys=nil)
  TkXIM.caret(self, keys=nil)
end
            
imconfiginfo(slot=nil) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 119
def imconfiginfo(slot=nil)
  TkXIM.configinfo(self, slot)
end
            
imconfigure(slot, value=None) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 115
def imconfigure(slot, value=None)
  TkXIM.configure(self, slot, value)
end
            
useinputmethods(value=None) click to toggle source
 
               # File tk/lib/tk/xim.rb, line 107
def useinputmethods(value=None)
  TkXIM.useinputmethods(value, self)
end