mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/lib/tk/*: untabify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5716ff7b80
commit
94d960beb5
296 changed files with 13591 additions and 13558 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Oct 11 13:48:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/lib/tk/*: untabify
|
||||||
|
|
||||||
Sun Oct 10 12:32:08 2004 Dave Thomas <dave@pragprog.com>
|
Sun Oct 10 12:32:08 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'
|
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'
|
||||||
|
|
|
||||||
|
|
@ -1839,7 +1839,6 @@ ip_ruby_cmd(clientData, interp, argc, argv)
|
||||||
thr_crit_bup = rb_thread_critical;
|
thr_crit_bup = rb_thread_critical;
|
||||||
rb_thread_critical = Qtrue;
|
rb_thread_critical = Qtrue;
|
||||||
|
|
||||||
|
|
||||||
old_gc = rb_gc_disable();
|
old_gc = rb_gc_disable();
|
||||||
|
|
||||||
res = TkStringValue(res);
|
res = TkStringValue(res);
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
# tk/canvas.rb - Tk canvas classes
|
# tk/canvas.rb - Tk canvas classes
|
||||||
# $Date$
|
# $Date$
|
||||||
# by Yukihiro Matsumoto <matz@caelum.co.jp>
|
# by Yukihiro Matsumoto <matz@caelum.co.jp>
|
||||||
# $Date$
|
|
||||||
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
|
|
||||||
#
|
#
|
||||||
require 'tk'
|
require 'tk'
|
||||||
require 'tk/canvastag'
|
require 'tk/canvastag'
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,14 @@ module TkWinDDE
|
||||||
tk_call_without_enc('package', 'require', 'dde')
|
tk_call_without_enc('package', 'require', 'dde')
|
||||||
end
|
end
|
||||||
|
|
||||||
def servername(topic=None)
|
#def servername(topic=None)
|
||||||
tk_call('dde', 'servername', topic)
|
# tk_call('dde', 'servername', topic)
|
||||||
end
|
#end
|
||||||
def servername(*args)
|
def servername(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
tk_call('dde', 'servername')
|
tk_call('dde', 'servername')
|
||||||
else
|
else
|
||||||
if args[-1].kind_of?(Hash)
|
if args[-1].kind_of?(Hash) # dde 1.2 +
|
||||||
keys = _symbolkey2str(args.pop)
|
keys = _symbolkey2str(args.pop)
|
||||||
force = (keys.delete('force'))? '-force': None
|
force = (keys.delete('force'))? '-force': None
|
||||||
exact = (keys.delete('exact'))? '-exact': None
|
exact = (keys.delete('exact'))? '-exact': None
|
||||||
|
|
@ -38,6 +38,8 @@ module TkWinDDE
|
||||||
tk_call('dde', 'servername', force, exact,
|
tk_call('dde', 'servername', force, exact,
|
||||||
*((hash_kv(keys) << '--') + args))
|
*((hash_kv(keys) << '--') + args))
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
tk_call('dde', 'servername', *args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def attributes(slot=nil,value=None)
|
def attributes(slot=nil,value=None)
|
||||||
if slot == nil
|
if slot == nil
|
||||||
lst = tk_split_list(tk_call('wm', 'attributes', path))
|
lst = tk_split_list(tk_call('wm', 'attributes', path))
|
||||||
|
|
@ -35,6 +36,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def client(name=None)
|
def client(name=None)
|
||||||
if name == None
|
if name == None
|
||||||
tk_call('wm', 'client', path)
|
tk_call('wm', 'client', path)
|
||||||
|
|
@ -44,6 +46,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def colormapwindows(*args)
|
def colormapwindows(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
list(tk_call_without_enc('wm', 'colormapwindows', path))
|
list(tk_call_without_enc('wm', 'colormapwindows', path))
|
||||||
|
|
@ -52,6 +55,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def wm_command(value=nil)
|
def wm_command(value=nil)
|
||||||
if value
|
if value
|
||||||
tk_call('wm', 'command', path, value)
|
tk_call('wm', 'command', path, value)
|
||||||
|
|
@ -61,10 +65,12 @@ module Tk
|
||||||
tk_call('wm', 'command', path)
|
tk_call('wm', 'command', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def deiconify(ex = true)
|
def deiconify(ex = true)
|
||||||
tk_call_without_enc('wm', 'deiconify', path) if ex
|
tk_call_without_enc('wm', 'deiconify', path) if ex
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
def focusmodel(mode = nil)
|
def focusmodel(mode = nil)
|
||||||
if mode
|
if mode
|
||||||
tk_call_without_enc('wm', 'focusmodel', path, mode)
|
tk_call_without_enc('wm', 'focusmodel', path, mode)
|
||||||
|
|
@ -73,9 +79,11 @@ module Tk
|
||||||
tk_call_without_enc('wm', 'focusmodel', path)
|
tk_call_without_enc('wm', 'focusmodel', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def frame
|
def frame
|
||||||
tk_call_without_enc('wm', 'frame', path)
|
tk_call_without_enc('wm', 'frame', path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def geometry(geom=nil)
|
def geometry(geom=nil)
|
||||||
if geom
|
if geom
|
||||||
tk_call_without_enc('wm', 'geometry', path, geom)
|
tk_call_without_enc('wm', 'geometry', path, geom)
|
||||||
|
|
@ -84,6 +92,7 @@ module Tk
|
||||||
tk_call_without_enc('wm', 'geometry', path)
|
tk_call_without_enc('wm', 'geometry', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def wm_grid(*args)
|
def wm_grid(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
list(tk_call_without_enc('wm', 'grid', path))
|
list(tk_call_without_enc('wm', 'grid', path))
|
||||||
|
|
@ -92,6 +101,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def group(leader = nil)
|
def group(leader = nil)
|
||||||
if leader
|
if leader
|
||||||
tk_call('wm', 'group', path, leader)
|
tk_call('wm', 'group', path, leader)
|
||||||
|
|
@ -100,6 +110,7 @@ module Tk
|
||||||
window(tk_call('wm', 'group', path))
|
window(tk_call('wm', 'group', path))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconbitmap(bmp=nil)
|
def iconbitmap(bmp=nil)
|
||||||
if bmp
|
if bmp
|
||||||
tk_call_without_enc('wm', 'iconbitmap', path, bmp)
|
tk_call_without_enc('wm', 'iconbitmap', path, bmp)
|
||||||
|
|
@ -108,10 +119,12 @@ module Tk
|
||||||
image_obj(tk_call_without_enc('wm', 'iconbitmap', path))
|
image_obj(tk_call_without_enc('wm', 'iconbitmap', path))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconify(ex = true)
|
def iconify(ex = true)
|
||||||
tk_call_without_enc('wm', 'iconify', path) if ex
|
tk_call_without_enc('wm', 'iconify', path) if ex
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconmask(bmp=nil)
|
def iconmask(bmp=nil)
|
||||||
if bmp
|
if bmp
|
||||||
tk_call_without_enc('wm', 'iconmask', path, bmp)
|
tk_call_without_enc('wm', 'iconmask', path, bmp)
|
||||||
|
|
@ -120,6 +133,7 @@ module Tk
|
||||||
image_obj(tk_call_without_enc('wm', 'iconmask', path))
|
image_obj(tk_call_without_enc('wm', 'iconmask', path))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconname(name=nil)
|
def iconname(name=nil)
|
||||||
if name
|
if name
|
||||||
tk_call('wm', 'iconname', path, name)
|
tk_call('wm', 'iconname', path, name)
|
||||||
|
|
@ -128,6 +142,7 @@ module Tk
|
||||||
tk_call('wm', 'iconname', path)
|
tk_call('wm', 'iconname', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconposition(*args)
|
def iconposition(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
list(tk_call_without_enc('wm', 'iconposition', path))
|
list(tk_call_without_enc('wm', 'iconposition', path))
|
||||||
|
|
@ -136,6 +151,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def iconwindow(win = nil)
|
def iconwindow(win = nil)
|
||||||
if win
|
if win
|
||||||
tk_call_without_enc('wm', 'iconwindow', path, win)
|
tk_call_without_enc('wm', 'iconwindow', path, win)
|
||||||
|
|
@ -145,6 +161,7 @@ module Tk
|
||||||
(w == '')? nil: window(w)
|
(w == '')? nil: window(w)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def maxsize(*args)
|
def maxsize(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
list(tk_call_without_enc('wm', 'maxsize', path))
|
list(tk_call_without_enc('wm', 'maxsize', path))
|
||||||
|
|
@ -153,6 +170,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def minsize(*args)
|
def minsize(*args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
list(tk_call_without_enc('wm', 'minsize', path))
|
list(tk_call_without_enc('wm', 'minsize', path))
|
||||||
|
|
@ -161,6 +179,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def overrideredirect(bool=None)
|
def overrideredirect(bool=None)
|
||||||
if bool == None
|
if bool == None
|
||||||
bool(tk_call_without_enc('wm', 'overrideredirect', path))
|
bool(tk_call_without_enc('wm', 'overrideredirect', path))
|
||||||
|
|
@ -169,6 +188,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def positionfrom(who=None)
|
def positionfrom(who=None)
|
||||||
if who == None
|
if who == None
|
||||||
r = tk_call_without_enc('wm', 'positionfrom', path)
|
r = tk_call_without_enc('wm', 'positionfrom', path)
|
||||||
|
|
@ -178,6 +198,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def protocol(name=nil, cmd=nil, &b)
|
def protocol(name=nil, cmd=nil, &b)
|
||||||
if cmd
|
if cmd
|
||||||
tk_call_without_enc('wm', 'protocol', path, name, cmd)
|
tk_call_without_enc('wm', 'protocol', path, name, cmd)
|
||||||
|
|
@ -192,6 +213,7 @@ module Tk
|
||||||
tk_split_simplelist(tk_call_without_enc('wm', 'protocol', path))
|
tk_split_simplelist(tk_call_without_enc('wm', 'protocol', path))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def resizable(*args)
|
def resizable(*args)
|
||||||
if args.length == 0
|
if args.length == 0
|
||||||
list(tk_call_without_enc('wm', 'resizable', path)).collect{|e| bool(e)}
|
list(tk_call_without_enc('wm', 'resizable', path)).collect{|e| bool(e)}
|
||||||
|
|
@ -200,6 +222,7 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def sizefrom(who=None)
|
def sizefrom(who=None)
|
||||||
if who == None
|
if who == None
|
||||||
r = tk_call_without_enc('wm', 'sizefrom', path)
|
r = tk_call_without_enc('wm', 'sizefrom', path)
|
||||||
|
|
@ -209,15 +232,19 @@ module Tk
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def stackorder
|
def stackorder
|
||||||
list(tk_call('wm', 'stackorder', path))
|
list(tk_call('wm', 'stackorder', path))
|
||||||
end
|
end
|
||||||
|
|
||||||
def stackorder_isabove(win)
|
def stackorder_isabove(win)
|
||||||
bool(tk_call('wm', 'stackorder', path, 'isabove', win))
|
bool(tk_call('wm', 'stackorder', path, 'isabove', win))
|
||||||
end
|
end
|
||||||
|
|
||||||
def stackorder_isbelow(win)
|
def stackorder_isbelow(win)
|
||||||
bool(tk_call('wm', 'stackorder', path, 'isbelow', win))
|
bool(tk_call('wm', 'stackorder', path, 'isbelow', win))
|
||||||
end
|
end
|
||||||
|
|
||||||
def state(state=nil)
|
def state(state=nil)
|
||||||
if state
|
if state
|
||||||
tk_call_without_enc('wm', 'state', path, state)
|
tk_call_without_enc('wm', 'state', path, state)
|
||||||
|
|
@ -226,6 +253,7 @@ module Tk
|
||||||
tk_call_without_enc('wm', 'state', path)
|
tk_call_without_enc('wm', 'state', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def title(str=nil)
|
def title(str=nil)
|
||||||
if str
|
if str
|
||||||
tk_call('wm', 'title', path, str)
|
tk_call('wm', 'title', path, str)
|
||||||
|
|
@ -234,6 +262,7 @@ module Tk
|
||||||
tk_call('wm', 'title', path)
|
tk_call('wm', 'title', path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def transient(master=nil)
|
def transient(master=nil)
|
||||||
if master
|
if master
|
||||||
tk_call_without_enc('wm', 'transient', path, master)
|
tk_call_without_enc('wm', 'transient', path, master)
|
||||||
|
|
@ -242,6 +271,7 @@ module Tk
|
||||||
window(tk_call_without_enc('wm', 'transient', path))
|
window(tk_call_without_enc('wm', 'transient', path))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def withdraw(ex = true)
|
def withdraw(ex = true)
|
||||||
tk_call_without_enc('wm', 'withdraw', path) if ex
|
tk_call_without_enc('wm', 'withdraw', path) if ex
|
||||||
self
|
self
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
require "tk"
|
require "tk"
|
||||||
|
|
||||||
TkButton.new(nil,
|
TkButton.new(nil,
|
||||||
'text' => 'hello',
|
:text => 'hello',
|
||||||
'command' => proc{print "hello\n"}).pack('fill'=>'x')
|
:command => proc{print "hello\n"}).pack(:fill=>'x')
|
||||||
TkButton.new(nil,
|
TkButton.new(nil,
|
||||||
'text' => 'quit',
|
:text => 'quit',
|
||||||
'command' => proc{exit}).pack('fill'=>'x')
|
:command => proc{exit}).pack(:fill=>'x')
|
||||||
|
|
||||||
Tk.mainloop
|
Tk.mainloop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue