In Files

  • tk/lib/tk/panedwindow.rb

Class/Module Index [+]

Quicksearch

Panedwindow

Public Instance Methods

add(*args) click to toggle source

def create_self(keys)

if keys and keys != None
  tk_call_without_enc('panedwindow', @path, *hash_kv(keys, true))
else
  tk_call_without_enc('panedwindow', @path)
end

end private :create_self

 
               # File tk/lib/tk/panedwindow.rb, line 19
def add(*args)
  keys = args.pop
  fail ArgumentError, "no window in arguments" unless keys
  if keys && keys.kind_of?(Hash)
    fail ArgumentError, "no window in arguments" if args == []
    # args = args.collect{|w| (w.kind_of?(TkObject))? w.epath: w }
    args = args.collect{|w| _epath(w) }
    #args.push(hash_kv(keys))
    args.concat(hash_kv(keys))
  else
    args.push(keys) if keys
    # args = args.collect{|w| (w.kind_of?(TkObject))? w.epath: w }
    args = args.collect{|w| _epath(w) }
  end
  tk_send_without_enc('add', *args)
  self
end
            
current_pane_configinfo(win, key=nil) click to toggle source
current_paneconfiginfo(win, key=nil) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 226
def current_paneconfiginfo(win, key=nil)
  if TkComm::GET_CONFIGINFO_AS_ARRAY
    if key
      conf = paneconfiginfo(win, key)
      {conf[0] => conf[4]}
    else
      ret = {}
      paneconfiginfo(win).each{|conf|
        ret[conf[0]] = conf[4] if conf.size > 2
      }
      ret
    end
  else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
    ret = {}
    paneconfiginfo(win, key).each{|k, conf|
      ret[k] = conf[-1] if conf.kind_of?(Array)
    }
    ret
  end
end
            
Also aliased as: current_pane_configinfo
del(win, *wins) click to toggle source
Alias for: forget
delete(win, *wins) click to toggle source
Alias for: forget
forget(win, *wins) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 37
def forget(win, *wins)
  wins.unshift(win)
  # tk_send_without_enc('forget', *((w.kind_of?(TkObject))? w.epath: w))
  tk_send_without_enc('forget', *(wins.collect{|w| _epath(w)}))
  self
end
            
Also aliased as: del, delete, remove
identify(x, y) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 47
def identify(x, y)
  list(tk_send_without_enc('identify', x, y))
end
            
pane_config(win, key, value=nil) click to toggle source
Alias for: paneconfigure
pane_configinfo(win, key=nil) click to toggle source
Alias for: paneconfiginfo
panecget(win, key) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 84
def panecget(win, key)
  unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
    panecget_strict(win, key)
  else
    begin
      panecget_strict(win, key)
    rescue => e
      begin
        if current_paneconfiginfo(win).has_key?(option.to_s)
          # not tag error & option is known -> error on known option
          fail e
        else
          # not tag error & option is unknown
          nil
        end
      rescue
        fail e  # tag error
      end
    end
  end
end
            
panecget_strict(win, key) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 79
def panecget_strict(win, key)
  # win = win.epath if win.kind_of?(TkObject)
  win = _epath(win)
  tk_tcl2ruby(tk_send_without_enc('panecget', win, "-#{key}"))
end
            
paneconfiginfo(win, key=nil) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 126
def paneconfiginfo(win, key=nil)
  if TkComm::GET_CONFIGINFO_AS_ARRAY
    # win = win.epath if win.kind_of?(TkObject)
    win = _epath(win)
    if key
      #conf = tk_split_list(tk_send_without_enc('paneconfigure', 
      #                                         win, "-#{key}"))
      conf = tk_split_list(tk_send_without_enc('paneconfigure', 
                                               win, "-#{key}"), 
                           false, true)
      conf[0] = conf[0][1..-1]
      if conf[0] == 'hide'
        conf[3] = bool(conf[3]) unless conf[3].empty?
        conf[4] = bool(conf[4]) unless conf[4].empty?
      end
      conf
    else
      #tk_split_simplelist(tk_send_without_enc('paneconfigure', 
      #                                        win)).collect{|conflist|
      #  conf = tk_split_simplelist(conflist)
      tk_split_simplelist(tk_send_without_enc('paneconfigure', win), 
                          false, false).collect{|conflist|
        conf = tk_split_simplelist(conflist, false, true)
        conf[0] = conf[0][1..-1]
        if conf[3]
          if conf[0] == 'hide'
            conf[3] = bool(conf[3]) unless conf[3].empty?
          elsif conf[3].index('{')
            conf[3] = tk_split_list(conf[3]) 
          else
            conf[3] = tk_tcl2ruby(conf[3]) 
          end
        end
        if conf[4]
          if conf[0] == 'hide'
            conf[4] = bool(conf[4]) unless conf[4].empty?
          elsif conf[4].index('{')
            conf[4] = tk_split_list(conf[4]) 
          else
            conf[4] = tk_tcl2ruby(conf[4]) 
          end
        end
        conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
        conf
      }
    end
  else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
    # win = win.epath if win.kind_of?(TkObject)
    win = _epath(win)
    if key
      #conf = tk_split_list(tk_send_without_enc('paneconfigure', 
      #                                         win, "-#{key}"))
      conf = tk_split_list(tk_send_without_enc('paneconfigure', 
                                               win, "-#{key}"), 
                           false, true)
      key = conf.shift[1..-1]
      if key == 'hide'
        conf[2] = bool(conf[2]) unless conf[2].empty?
        conf[3] = bool(conf[3]) unless conf[3].empty?
      end
      { key => conf }
    else
      ret = {}
      #tk_split_simplelist(tk_send_without_enc('paneconfigure', 
      #                                        win)).each{|conflist|
      #  conf = tk_split_simplelist(conflist)
      tk_split_simplelist(tk_send_without_enc('paneconfigure', win), 
                          false, false).each{|conflist|
        conf = tk_split_simplelist(conflist, false, true)
        key = conf.shift[1..-1]
        if key
          if key == 'hide'
            conf[2] = bool(conf[2]) unless conf[2].empty?
          elsif conf[2].index('{')
            conf[2] = tk_split_list(conf[2]) 
          else
            conf[2] = tk_tcl2ruby(conf[2]) 
          end
        end
        if conf[3]
          if key == 'hide'
            conf[3] = bool(conf[3]) unless conf[3].empty?
          elsif conf[3].index('{')
            conf[3] = tk_split_list(conf[3]) 
          else
            conf[3] = tk_tcl2ruby(conf[3]) 
          end
        end
        if conf.size == 1
          ret[key] = conf[0][1..-1]  # alias info
        else
          ret[key] = conf
        end
      }
      ret
    end
  end
end
            
Also aliased as: pane_configinfo
paneconfigure(win, key, value=nil) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 106
def paneconfigure(win, key, value=nil)
  # win = win.epath if win.kind_of?(TkObject)
  win = _epath(win)
  if key.kind_of? Hash
    params = []
    key.each{|k, v|
      params.push("-#{k}")
      # params.push((v.kind_of?(TkObject))? v.epath: v)
      params.push(_epath(v))
    }
    tk_send_without_enc('paneconfigure', win, *params)
  else
    # value = value.epath if value.kind_of?(TkObject)
    value = _epath(value)
    tk_send_without_enc('paneconfigure', win, "-#{key}", value)
  end
  self
end
            
Also aliased as: pane_config
panes() click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 249
def panes
  list(tk_send_without_enc('panes'))
end
            
proxy_coord() click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 51
def proxy_coord
  list(tk_send_without_enc('proxy', 'coord'))
end
            
proxy_forget() click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 54
def proxy_forget
  tk_send_without_enc('proxy', 'forget')
  self
end
            
proxy_place(x, y) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 58
def proxy_place(x, y)
  tk_send_without_enc('proxy', 'place', x, y)
  self
end
            
remove(win, *wins) click to toggle source
Alias for: forget
sash_coord(index) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 63
def sash_coord(index)
  list(tk_send('sash', 'coord', index))
end
            
sash_dragto(index, x, y) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 66
def sash_dragto(index, x, y)
  tk_send('sash', 'dragto', index, x, y)
  self
end
            
sash_mark(index, x, y) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 70
def sash_mark(index, x, y)
  tk_send('sash', 'mark', index, x, y)
  self
end
            
sash_place(index, x, y) click to toggle source
 
               # File tk/lib/tk/panedwindow.rb, line 74
def sash_place(index, x, y)
  tk_send('sash', 'place', index, x, y)
  self
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus