E
email55555 email55555
A sample Tk program likes:
require 'tk'
TkLabel.newtext=>'Hello').pack
Tk.mainloop
Save it to a file named as "tk" or "tk.rb" do not have any problem to run it.
However, save it to a file like "button.rb" or "scale.rb",
when run it, you will get trouble.
I know that it is not a good idea to save Tk program to button.rb or
scale.rb ... etc. But I would like to understand:
(1) What's going wrong ? File name collision with Tk lib ?
( require 'tk' will load no correct files ?)
(2) So, what are names need to be avoid to use ?
All files name under <ruby_home> / lib / ruby / 1.8 / tk are reserved
file names when using tk library ?
If I am using tkextlib, I must avoid using file names under the
tkextlib folder too ?
Thank you.
require 'tk'
TkLabel.newtext=>'Hello').pack
Tk.mainloop
Save it to a file named as "tk" or "tk.rb" do not have any problem to run it.
However, save it to a file like "button.rb" or "scale.rb",
when run it, you will get trouble.
I know that it is not a good idea to save Tk program to button.rb or
scale.rb ... etc. But I would like to understand:
(1) What's going wrong ? File name collision with Tk lib ?
( require 'tk' will load no correct files ?)
(2) So, what are names need to be avoid to use ?
All files name under <ruby_home> / lib / ruby / 1.8 / tk are reserved
file names when using tk library ?
If I am using tkextlib, I must avoid using file names under the
tkextlib folder too ?
Thank you.