1
0
Fork 0
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/trunk@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2004-10-11 04:51:21 +00:00
parent 05f5928c9d
commit 3514110b89
296 changed files with 13591 additions and 13558 deletions

View file

@ -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>
* lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'

View file

@ -1839,7 +1839,6 @@ ip_ruby_cmd(clientData, interp, argc, argv)
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
old_gc = rb_gc_disable();
res = TkStringValue(res);

View file

@ -2,8 +2,6 @@
# tk/canvas.rb - Tk canvas classes
# $Date$
# by Yukihiro Matsumoto <matz@caelum.co.jp>
# $Date$
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
#
require 'tk'
require 'tk/canvastag'

View file

@ -19,14 +19,14 @@ module TkWinDDE
tk_call_without_enc('package', 'require', 'dde')
end
def servername(topic=None)
tk_call('dde', 'servername', topic)
end
#def servername(topic=None)
# tk_call('dde', 'servername', topic)
#end
def servername(*args)
if args.size == 0
tk_call('dde', 'servername')
else
if args[-1].kind_of?(Hash)
if args[-1].kind_of?(Hash) # dde 1.2 +
keys = _symbolkey2str(args.pop)
force = (keys.delete('force'))? '-force': None
exact = (keys.delete('exact'))? '-exact': None
@ -38,6 +38,8 @@ module TkWinDDE
tk_call('dde', 'servername', force, exact,
*((hash_kv(keys) << '--') + args))
end
else
tk_call('dde', 'servername', *args)
end
end
end

View file

@ -17,6 +17,7 @@ module Tk
self
end
end
def attributes(slot=nil,value=None)
if slot == nil
lst = tk_split_list(tk_call('wm', 'attributes', path))
@ -35,6 +36,7 @@ module Tk
self
end
end
def client(name=None)
if name == None
tk_call('wm', 'client', path)
@ -44,6 +46,7 @@ module Tk
self
end
end
def colormapwindows(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'colormapwindows', path))
@ -52,6 +55,7 @@ module Tk
self
end
end
def wm_command(value=nil)
if value
tk_call('wm', 'command', path, value)
@ -61,10 +65,12 @@ module Tk
tk_call('wm', 'command', path)
end
end
def deiconify(ex = true)
tk_call_without_enc('wm', 'deiconify', path) if ex
self
end
def focusmodel(mode = nil)
if mode
tk_call_without_enc('wm', 'focusmodel', path, mode)
@ -73,9 +79,11 @@ module Tk
tk_call_without_enc('wm', 'focusmodel', path)
end
end
def frame
tk_call_without_enc('wm', 'frame', path)
end
def geometry(geom=nil)
if geom
tk_call_without_enc('wm', 'geometry', path, geom)
@ -84,6 +92,7 @@ module Tk
tk_call_without_enc('wm', 'geometry', path)
end
end
def wm_grid(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'grid', path))
@ -92,6 +101,7 @@ module Tk
self
end
end
def group(leader = nil)
if leader
tk_call('wm', 'group', path, leader)
@ -100,6 +110,7 @@ module Tk
window(tk_call('wm', 'group', path))
end
end
def iconbitmap(bmp=nil)
if bmp
tk_call_without_enc('wm', 'iconbitmap', path, bmp)
@ -108,10 +119,12 @@ module Tk
image_obj(tk_call_without_enc('wm', 'iconbitmap', path))
end
end
def iconify(ex = true)
tk_call_without_enc('wm', 'iconify', path) if ex
self
end
def iconmask(bmp=nil)
if bmp
tk_call_without_enc('wm', 'iconmask', path, bmp)
@ -120,6 +133,7 @@ module Tk
image_obj(tk_call_without_enc('wm', 'iconmask', path))
end
end
def iconname(name=nil)
if name
tk_call('wm', 'iconname', path, name)
@ -128,6 +142,7 @@ module Tk
tk_call('wm', 'iconname', path)
end
end
def iconposition(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'iconposition', path))
@ -136,6 +151,7 @@ module Tk
self
end
end
def iconwindow(win = nil)
if win
tk_call_without_enc('wm', 'iconwindow', path, win)
@ -145,6 +161,7 @@ module Tk
(w == '')? nil: window(w)
end
end
def maxsize(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'maxsize', path))
@ -153,6 +170,7 @@ module Tk
self
end
end
def minsize(*args)
if args.size == 0
list(tk_call_without_enc('wm', 'minsize', path))
@ -161,6 +179,7 @@ module Tk
self
end
end
def overrideredirect(bool=None)
if bool == None
bool(tk_call_without_enc('wm', 'overrideredirect', path))
@ -169,6 +188,7 @@ module Tk
self
end
end
def positionfrom(who=None)
if who == None
r = tk_call_without_enc('wm', 'positionfrom', path)
@ -178,6 +198,7 @@ module Tk
self
end
end
def protocol(name=nil, cmd=nil, &b)
if 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))
end
end
def resizable(*args)
if args.length == 0
list(tk_call_without_enc('wm', 'resizable', path)).collect{|e| bool(e)}
@ -200,6 +222,7 @@ module Tk
self
end
end
def sizefrom(who=None)
if who == None
r = tk_call_without_enc('wm', 'sizefrom', path)
@ -209,15 +232,19 @@ module Tk
self
end
end
def stackorder
list(tk_call('wm', 'stackorder', path))
end
def stackorder_isabove(win)
bool(tk_call('wm', 'stackorder', path, 'isabove', win))
end
def stackorder_isbelow(win)
bool(tk_call('wm', 'stackorder', path, 'isbelow', win))
end
def state(state=nil)
if state
tk_call_without_enc('wm', 'state', path, state)
@ -226,6 +253,7 @@ module Tk
tk_call_without_enc('wm', 'state', path)
end
end
def title(str=nil)
if str
tk_call('wm', 'title', path, str)
@ -234,6 +262,7 @@ module Tk
tk_call('wm', 'title', path)
end
end
def transient(master=nil)
if master
tk_call_without_enc('wm', 'transient', path, master)
@ -242,6 +271,7 @@ module Tk
window(tk_call_without_enc('wm', 'transient', path))
end
end
def withdraw(ex = true)
tk_call_without_enc('wm', 'withdraw', path) if ex
self

View file

@ -1,10 +1,10 @@
require "tk"
TkButton.new(nil,
'text' => 'hello',
'command' => proc{print "hello\n"}).pack('fill'=>'x')
:text => 'hello',
:command => proc{print "hello\n"}).pack(:fill=>'x')
TkButton.new(nil,
'text' => 'quit',
'command' => proc{exit}).pack('fill'=>'x')
:text => 'quit',
:command => proc{exit}).pack(:fill=>'x')
Tk.mainloop