Ruby/Tk :: Opening a new window when selecting menu items

Thanks a ton guys, I got it working and am moving along. Heres the code that worked:

filemenu.add(‘command’, ‘label’=>“Blah”, ‘command’=>proc {
toplevelwindow = TkToplevel.new(root) {
title "New window"
geometry(“50x50+100+100”)
configure(‘bg’=>“black”)
}

toplevelbutton = TkButton.new(toplevelwindow) {
text "Close"
command proc { toplevelwindow.destroy }
}.place(‘x’=>10, ‘y’=>10)
}

I hope that this will help anyone trying to do this same thing with Ruby/Tk. By the way, I am also documenting all the stuff I learn and hope to one day put out a fairly complete guide/tutorial to Ruby/Tk. Agian, thanks for the help.

->Kryptik

···


Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup