Is there a way to access tcl global variables from a callback by directly
using tcl code?
This code does not work:
##test.rb###############
require 'tk'
def button_callback
p root.ip_eval("info globals")
root.ip_eval("puts $tcl_version") #problem
end
root=Tk.root
button=TkButton.new(root){
command proc{button_callback}
}
button.pack
root.mainloop
···
########################
The interpreter responds with:
RuntimeError: can't read "tcl_version": no such variable
Calling "info globals" gives "tcl_version" as an existing global variable
The (almost) equivalent python code works:
#test.py################
from Tkinter import *
def button_callback():
print root.tk.eval("info globals")
root.tk.eval("puts $tcl_version")
root=Tk()
button=Button(root)
button["command"]= button_callback
button.pack()
root.mainloop()
########################
Thanks.