Mega Code Archive

 
Categories / Ruby / Tk
 

Grid layout manager places its child widgets in a table-like arrangement

require 'tk' root = TkRoot.new 3.times { |r|   4.times { |c|     TkLabel.new(root) {       text "row #{r}, column #{c}"     }.grid('row' => r, 'column' => c, 'padx' => 10, 'pady' => 10)   } } Tk.mainloop