Method: Tk::Wm.protocol

Defined in:
ext/lib/tk/wm.rb

.protocol(win, name = nil, cmd = nil, &b) ⇒ Object



385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'ext/lib/tk/wm.rb', line 385

def Wm.protocol(win, name=nil, cmd=nil, &b)
  if cmd
    tk_call_without_enc('wm', 'protocol', win.epath, name, cmd)
    win
  elsif b
    tk_call_without_enc('wm', 'protocol', win.epath, name, proc(&b))
    win
  elsif name
    result = tk_call_without_enc('wm', 'protocol', win.epath, name)
    (result == "")? nil : tk_tcl2ruby(result)
  else
    tk_split_simplelist(tk_call_without_enc('wm', 'protocol', win.epath))
  end
end