What’s the best (and simplest) method of having a menu item produce
another widget (a menu for example)? So far I have code as shown below
which calls a simple button. I’d like to use the proc{foo} method so
that I can call another file. The idea is to have each type of widget
organised into many smaller files.
It the proc{require ‘another_widget’} way possible or recommended?
here’s a menu entry that calls another widget…
[['Blah', 0],
['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)
}],
],
[['Blah', 0],
['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)
}],
],