List Info

Thread: FXTable initialization bug?




FXTable initialization bug?
user name
2006-09-25 20:43:13
Hi,

Firstly, sorry for flooding this forum with bug reports:
FXRuby works just fine except a few minor glitches...

Here is another one: when clicking outside an FXTable
visible cells (either on the right or at the bottom), when
no cell have ever been selected, the app SEGFAULTs.
Preselecting a cell corrects the problem.

Demo code 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)
    FXMenuCommand.new(filemenu,
"&Quit\tCtl-Q\tQuit the application",
        nil, app, FXApp::ID_QUIT)
    FXMenuTitle.new(menubar, "&File", nil,
filemenu)
    
    # Tabbook
    tabbook = FXTabBook.new(self, nil, 0,
        LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
    tab = FXTabItem.new(tabbook,
"FXTable", nil)
    
    # FXTable
    table = FXTable.new(tabbook, nil, 0,
       
TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FIL
L_Y,
        0, 0, 0, 0, 2, 2, 2, 2)
    table.visibleRows = 10
    table.visibleColumns = 4
    table.setTableSize(10, 4)
    
    # Initialize columns
    table.setColumnText(0, "A")
    table.setColumnText(1, "B")
    table.setColumnText(2, "C")
    table.setColumnText(3, "D")
    
    # Initialize rows
    (0...10).each { |r| table.setRowText(r,
"Row #") }
    
    # FXRuby bug workaround: one cell must be selected,
otherwise app crashes
    # when a click is done outside the table
    #table.setCurrentItem(0, 0)
    
  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

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

FXRuby 1.6.2 for Ryby 1.8.4, Windows XP

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

_______________________________________________
fxruby-users mailing list
fxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
FXTable initialization bug?
user name
2006-09-26 00:54:06
On Sep 25, 2006, at 3:43 PM, Philippe Lang wrote:

> Here is another one: when clicking outside an FXTable
visible cells  
> (either on the right or at the bottom), when no cell
have ever been  
> selected, the app SEGFAULTs. Preselecting a cell
corrects the problem.

OK. I know this problem has been reported in the past, but I
don't  
see it in the bug list, so I've just added a bug report on
your behalf.
_______________________________________________
fxruby-users mailing list
fxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/fxruby-users
[1-2]

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