Created
April 17, 2013 02:58
-
-
Save windwiny/5401448 to your computer and use it in GitHub Desktop.
Ruby get Tk Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tk' | |
File.open '/tmp/tk1.txt', 'w' do |f| | |
Object.constants.grep( /^Tk/).sort.each do |x| | |
n = Object.const_get x rescue x | |
f.puts "#{x} \t#{n.to_s} \t#{n.__id__}" | |
end | |
end | |
File.open '/tmp/ttk1.txt', 'w' do |f| | |
Ttk.constants.sort.each do |x| | |
n = Ttk.const_get x rescue x | |
f.puts "#{x} \t#{n.to_s} \t#{n.__id__}" | |
end | |
end | |
File.open '/tmp/tktile1.txt', 'w' do |f| | |
Tk::Tile.constants.sort.each do |x| | |
n = Tk::Tile.const_get x rescue x | |
f.puts "#{x} \t#{n.to_s} \t#{n.__id__}" | |
end | |
end | |
File.open '/tmp/tki1.txt', 'w' do |f| | |
Tk.constants.sort.each do |x| | |
n = Tk.const_get(x) rescue x | |
f.puts "#{x} \t#{n.to_s rescue nil} \t#{n.__id__}" | |
end | |
end | |
__END__ | |
# TkXXX, size == 153 | |
# Ttk::XXX == Tk::Tile::XXX , size == 62 | |
# Tk::XXX, size ~= 65 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment