From: Hidetoshi NAGAI Date: 2006-05-25T18:13:54+09:00 Subject: Re: ruby tk grid question From: Jon Dean Subject: Re: ruby tk grid question Date: Thu, 25 May 2006 17:32:09 +0900 Message-ID: <435954a7d4aed3bd8b393cb4c5c469d5@ruby-forum.com> > Ok, that makes sense. I read through that quickly but didn't make the > connection. I am not exactly sure what the master index is though. If > I have a frame(=top) within root and several frames within 'top', what > would the master index refer to? Thanks for the help. Maybe, I'm misunderstanding your question. First of all, the followings are same. Ruby/Tk:: date.grid_columnconfigure(1, :weight=>1) Ruby/Tk:: TkGrid.columnconfigure(date, 1, :weight=>1) Tcl/Tk :: grid columnconfigure date 1 -weight 1 ## NOTE: 'date' in the case of Tcl/Tk means the widget path of ## the 'date' frame widget. In those cases, the master is the frame widget 'date'. And the index is 1, that is, the 2nd column of the grid table. ( the index of 1st column is 0. ) The default weight value of each column is 0. All of those columns aren't assigned free area arised from resizing the master ('date' frame). So, the small grid table is placed at the center of the master, and has free areas at each side. After calling the columnconfigure, the free area is allocated by the weight ratio ( column0 : column1 = 0 : 1 ). It enlarges the width of column1 only. And now, the 'sticky' option gets the chance of working. The area of the column1 is larger than the size of the label widget. The label widget is placed depend on the value of 'sticky' option. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)