* ext/tk/extconf.rb: support s390x (Thanks to bkabrda) [ruby-trunk - Bug #5465]
* ext/tk/extconf.rb: apply [Backport87 - Backport #5048] * ext/tk/lib/tk/canvas.rb, ext/tk/sample/demos-{en,jp}/{tree.rb,widget}: fix bug (Thanks to zzak) [ruby-trunk - Bug #8319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4c68aa718d
commit
c58dc63686
@ -114,7 +114,7 @@ def is_macosx?
|
|||||||
end
|
end
|
||||||
|
|
||||||
def maybe_64bit?
|
def maybe_64bit?
|
||||||
/64|universal/ =~ RUBY_PLATFORM
|
/64|universal|s390x/ =~ RUBY_PLATFORM
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_tcltk_version(version)
|
def check_tcltk_version(version)
|
||||||
@ -313,7 +313,9 @@ def find_macosx_framework
|
|||||||
paths.reverse! unless TkLib_Config["ActiveTcl"] # system has higher priority
|
paths.reverse! unless TkLib_Config["ActiveTcl"] # system has higher priority
|
||||||
|
|
||||||
paths.map{|dir| dir.strip.chomp('/')}.each{|dir|
|
paths.map{|dir| dir.strip.chomp('/')}.each{|dir|
|
||||||
|
next unless File.exist?(File.join(dir, "Tcl.framework", "Headers"))
|
||||||
next unless File.directory?(tcldir = File.join(dir, "Tcl.framework"))
|
next unless File.directory?(tcldir = File.join(dir, "Tcl.framework"))
|
||||||
|
next unless File.exist?(File.join(dir, "Tk.framework"), "Headers")
|
||||||
next unless File.directory?(tkdir = File.join(dir, "Tk.framework"))
|
next unless File.directory?(tkdir = File.join(dir, "Tk.framework"))
|
||||||
TkLib_Config["tcltk-framework"] = dir
|
TkLib_Config["tcltk-framework"] = dir
|
||||||
return [tcldir, tkdir]
|
return [tcldir, tkdir]
|
||||||
|
@ -85,11 +85,16 @@ class Tk::Canvas<TkWindow
|
|||||||
|
|
||||||
# create a canvas item without creating a TkcItem object
|
# create a canvas item without creating a TkcItem object
|
||||||
def create(type, *args)
|
def create(type, *args)
|
||||||
type = TkcItem.type2class(type.to_s) unless type.kind_of?(TkcItem)
|
if type.kind_of?(Class) && type < TkcItem
|
||||||
|
# do nothing
|
||||||
|
elsif TkcItem.type2class(type.to_s)
|
||||||
|
type = TkcItem.type2class(type.to_s)
|
||||||
|
else
|
||||||
|
fail ArgumentError, "type must a subclass of TkcItem class, or a string in CItemTypeToClass"
|
||||||
|
end
|
||||||
type.create(self, *args)
|
type.create(self, *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def addtag(tag, mode, *args)
|
def addtag(tag, mode, *args)
|
||||||
mode = mode.to_s
|
mode = mode.to_s
|
||||||
if args[0] && mode =~ /^(above|below|with(tag)?)$/
|
if args[0] && mode =~ /^(above|below|with(tag)?)$/
|
||||||
|
@ -67,7 +67,7 @@ def populate_tree(tree, node)
|
|||||||
path = tree.get(node, :fullpath)
|
path = tree.get(node, :fullpath)
|
||||||
tree.delete(tree.children(node))
|
tree.delete(tree.children(node))
|
||||||
Dir.glob("#{path}/*").sort.each{|f|
|
Dir.glob("#{path}/*").sort.each{|f|
|
||||||
type = File.ftype(f)
|
type = File.ftype(f) rescue nil
|
||||||
id = tree.insert(node, :end,
|
id = tree.insert(node, :end,
|
||||||
:text=>File.basename(f), :values=>[f, type]).id
|
:text=>File.basename(f), :values=>[f, type]).id
|
||||||
if type == 'directory'
|
if type == 'directory'
|
||||||
|
@ -683,7 +683,7 @@ def eval_samplecode(code, file=nil)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# invoke --
|
# invoke --
|
||||||
@ -699,7 +699,7 @@ def invoke(txt, idx)
|
|||||||
|
|
||||||
cursor = txt.cget('cursor')
|
cursor = txt.cget('cursor')
|
||||||
txt.cursor('watch')
|
txt.cursor('watch')
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
# eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
|
# eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
|
||||||
# Tk.update
|
# Tk.update
|
||||||
eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
|
eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
|
||||||
@ -1058,7 +1058,7 @@ if ARGV[0] == '-n'
|
|||||||
no_launcher = true if ARGV.size > 0
|
no_launcher = true if ARGV.size > 0
|
||||||
else
|
else
|
||||||
# show the root widget to make it lower then demo windows
|
# show the root widget to make it lower then demo windows
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
end
|
end
|
||||||
ARGV.each{|cmd|
|
ARGV.each{|cmd|
|
||||||
if cmd =~ /(.*).rb/
|
if cmd =~ /(.*).rb/
|
||||||
|
@ -68,7 +68,7 @@ def populate_tree(tree, node)
|
|||||||
path = tree.get(node, :fullpath)
|
path = tree.get(node, :fullpath)
|
||||||
tree.delete(tree.children(node))
|
tree.delete(tree.children(node))
|
||||||
Dir.glob("#{path}/*").sort.each{|f|
|
Dir.glob("#{path}/*").sort.each{|f|
|
||||||
type = File.ftype(f)
|
type = File.ftype(f) rescue nil
|
||||||
id = tree.insert(node, :end,
|
id = tree.insert(node, :end,
|
||||||
:text=>File.basename(f), :values=>[f, type]).id
|
:text=>File.basename(f), :values=>[f, type]).id
|
||||||
if type == 'directory'
|
if type == 'directory'
|
||||||
|
@ -740,7 +740,7 @@ def eval_samplecode(code, file=nil)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# テキスト上での click に対する動作
|
# テキスト上での click に対する動作
|
||||||
@ -750,7 +750,7 @@ def invoke(txt, idx)
|
|||||||
|
|
||||||
cursor = txt.cget('cursor')
|
cursor = txt.cget('cursor')
|
||||||
txt.cursor('watch')
|
txt.cursor('watch')
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
# eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
|
# eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
|
||||||
# Tk.update
|
# Tk.update
|
||||||
eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
|
eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
|
||||||
@ -1094,7 +1094,7 @@ if ARGV[0] == '-n'
|
|||||||
no_launcher = true if ARGV.size > 0
|
no_launcher = true if ARGV.size > 0
|
||||||
else
|
else
|
||||||
# show the root widget to make it lower then demo windows
|
# show the root widget to make it lower then demo windows
|
||||||
Tk.update
|
Tk.update rescue nil
|
||||||
end
|
end
|
||||||
ARGV.each{|cmd|
|
ARGV.each{|cmd|
|
||||||
if cmd =~ /(.*).rb/
|
if cmd =~ /(.*).rb/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user