List Info

Thread: FXTable.setTableSize & clic -> crash




FXTable.setTableSize & clic -> crash
user name
2006-10-29 18:00:18
Hi Lyle,

Thanks for the new version of FXRuby 1.6.3!

There is still a bug in FXRuby 1.6.3, that crashes the
application when you click outside the visible cells of an
FXTable where no cell was selected yet.

`setCurrentItem': table row out of bounds (IndexError)


Note this happens only if the table is being initialized
with:

    t.visibleRows = 3
    t.visibleColumns = 3
    t.setTableSize(3, 3)

With the following equivalent (?) lines, the problem
disappears:

    t.appendRows(3)
    t.appendColumns(3)


Maybe I'm doing something wrong?


Test code is provided here:

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

#!/usr/bin/ruby

require 'fox16'

include Fox

class MyWindow < FXMainWindow
    
  def initialize(app)

    super(app, "Window", nil, nil, DECOR_ALL, 0,
0, 600, 350)

    # Menu bar stretched along the top of the main window
    menubar = FXMenuBar.new(self,
LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
  
    # File menu
    filemenu = FXMenuPane.new(self)
    FXMenuTitle.new(menubar, "&File", nil,
filemenu)
    FXMenuCommand.new(filemenu, "&QuittCtl-QtQuit
the application",
        nil, app, FXApp::ID_QUIT)

    # Table
    f = FXHorizontalFrame.new(self,
LAYOUT_FILL_X|LAYOUT_FILL_Y)
    t = FXTable.new(f, nil, 0,
TABLE_COL_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y)
    
    t.visibleRows = 3
    t.visibleColumns = 3
    t.setTableSize(3, 3)
    
    # Note: problem disappears if you use the following code
    # instead of the 3 lines above:
    
    #t.appendRows(3)
    #t.appendColumns(3)
    
  end

  def create
    super
    show(PLACEMENT_SCREEN)
  end
  
end

if __FILE__ == $0
  application = FXApp.new("Attik System",
"FXRuby Test")
  MyWindow.new(application)
  application.create
  application.run
End


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


Cheers,

---------------
Philippe Lang
Attik System

_______________________________________________
fxruby-users mailing list
fxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
FXTable.setTableSize & clic -> crash
user name
2006-10-30 14:00:42
On Oct 29, 2006, at 12:00 PM, Philippe Lang wrote:

> There is still a bug in FXRuby 1.6.3, that crashes the
application  
> when you click outside the visible cells of an FXTable
where no  
> cell was selected yet.

Still on the bug list, here:

	http://rubyfo
rge.org/tracker/index.php? 
func=detail&aid=5907&group_id=300&atid=1223

This is of lower priority since there are workarounds, but
I'll see  
if it can be fixed in the next release.
_______________________________________________
fxruby-users mailing list
fxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
FXTable.setTableSize & clic -> crash
user name
2006-10-30 14:00:42
On Oct 29, 2006, at 12:00 PM, Philippe Lang wrote:

> There is still a bug in FXRuby 1.6.3, that crashes the
application  
> when you click outside the visible cells of an FXTable
where no  
> cell was selected yet.

Still on the bug list, here:

	http://rubyfo
rge.org/tracker/index.php? 
func=detail&aid=5907&group_id=300&atid=1223

This is of lower priority since there are workarounds, but
I'll see  
if it can be fixed in the next release.
_______________________________________________
fxruby-users mailing list
fxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )