Markus Weihs
6/22/2005 12:43:00 PM
Hi!
> what command should i give in Button to exit only TkToplevel?
Use "destroy" instead of "exit". Here's a little example snippet:
require 'tk'
def new_one(l)
top = TkToplevel.new(root)
e1 = TkEntry.new(top).pack
TkButton.new(top) {
text "Ok"
command proc{
l.configure('text'=>e1.get)
top.destroy
}
pack
}
end
root = TkRoot.new
l = TkLabel.new(root, 'text'=>'Some Text').pack
TkButton.new(root) {
text "Change Text"
command proc{new_one(l)}
pack
}
Tk.mainloop()
Regards, Markus