I am new to the Ruby. I try to test the Ruby/Tk and enter the follow
program.
require 'tk'
root = TkRoot.new {
title 'Frames'
}
[ 'raised', 'sunken', 'flat', 'ridge', 'groove', 'solid' ].each do |relief|
f = TkFrame.new(root){
borderwidth 2
relief relief
pack { side 'left'; padx 5; pady 5 }
}
TkLabel.new(f){
text relief
width 10
pack { side 'left' }
}
end
root.mainloop
I expected to see a row of labels. Instead I got a window with a column of
labels.
If I change the pack block to
pack( 'side' => 'left', 'padx' => 5, 'pady' => 5 )
The display change to a row of labels. Could anyone tell me what's the
difference between the two ways of calling pack. Thanks
Steve