[fxruby-users] Fixed column widths in FXTable?

David Peoples davidp at touringcyclist.com
Fri Feb 18 16:56:24 EST 2005


Is there a way to make an FXTable's column widths (and row heights) 
unchangeable by the user? By experimentation it looks to me like leaving 
out TABLE_COL_SIZABLE and TABLE_ROW_SIZABLE from the options field in 
FXTable.new() has no effect. I can still drag the intersection between 
two column heading buttons to change the column width. The code I'm 
using to test this is below.

The test is on a machine running Windows XP Home, service pack 2. The 
base Ruby installation is the "One Click Ruby Installer" version 
1.8.2-14 final (ruby182-14.exe). I've installed FXRuby version 1.2.3 on 
top of the version included with the one click installer 
(FXRuby-1.2.3-ruby182.exe). fxversion() reports "1.2.13" from the irb 
command prompt. The machine has a Pentium 4 and 256mb ram.

-------------------------------------------------------------------------

require "fox12"
include Fox

class TestWindow < FXMainWindow

   def initialize(app)
     super(app, "MyTest", nil, nil, DECOR_ALL, 0, 0, 600, 400, 0, 0)
     table = FXTable.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
     table.setTableSize(50, 3)
     (0...50).each do |r|
       table.setItemText(r, 0, "#{r},0")
       table.setItemText(r, 1, "#{r},1")
       table.setItemText(r, 2, "#{r},2")
     end
   end

   def create
     super
     show(PLACEMENT_SCREEN)
   end

end

def runme
   application = FXApp.new("MyTest", "FoxTest")
   TestWindow.new(application)
   application.create
   application.run
end

runme

-------------------------------------------------------------------------


-- 
David Peoples  davidp at touringcyclist.com
The Touring Cyclist  http://www.touringcyclist.com
11816 St. Charles Rock Road, Bridgeton, MO 63044
tel: 314-739-4648  fax: 314-739-4972


More information about the fxruby-users mailing list