Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

FXComboTableItem bug

#16

Originally reported by Jason Thomas (jmthomas@ball.com):

I think there is a bug in FXComboTableItem when using it with FXTable. I was getting a Seg Fault before making the following change:

class FXComboTableItem < FXTableItem
  # Create input control for editing this item
  def getControlFor(table)
    combo = FXComboBox.new(table, 1, nil, 0, COMBOBOX_STATIC, 0, 0, 0, 0,
                            table.marginLeft, table.marginRight,
                            table.marginTop, table.marginBottom)
    combo.create
    combo.justify = justify
    combo.font = table.font
    combo.backColor = table.backColor
    combo.textColor = table.textColor
    combo.selBackColor = table.selBackColor
    combo.selTextColor = table.selTextColor
    selections.each do |selection|
      combo.appendItem(selection)
    end
    combo.numVisible = [20, combo.numItems].min
    combo
  end
end

The original code used combo.fillItems(selections) instead of combo.appendItem so I think that's where the problem is.

Reported by lyle (at lylejohnson) · November 11th, 2009 @ 06:55 PM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. lyle (at lylejohnson)
  2. lyle (at lylejohnson)
    lyle (at lylejohnson)

    Lyle replied:

    Jason, I'm having trouble reproducing this one. Which operating system are you FXRuby running on?

    November 11th, 2009 @ 06:56 PM

  3. lyle (at lylejohnson)
    lyle (at lylejohnson)

    Lyle added:

    Anecdotal evidence (i.e. a subsequent bug report from Ernst Tanaka) confirms that something about the FXComboBox#fillItems method is broken.

    November 11th, 2009 @ 06:56 PM

  4. lyle (at lylejohnson)
    lyle (at lylejohnson)

    Tim Smith added that:

    FXComboTableItem#fillItems seg-faults for me in the following code on WinXP, Ruby 1.8.6, FXRuby 1.6.14. appendItem does not seg-fault.

    app = FXApp.new
    main_window = FXMainWindow.new app, 'Test'
    combo_box = FXComboBox.new main_window, 20
    items = ['item 1', 'item 2']
    combo_box.fillItems items
    #items.each {|item| combo_box.appendItem item}
    app.create
    main_window.show PLACEMENT_SCREEN
    app.run
    

    November 11th, 2009 @ 06:57 PM

  5. lyle (at lylejohnson)
    lyle (at lylejohnson)

    Added a test for this, which passes on Mac OS X. Will try on Windows.

    November 11th, 2009 @ 06:58 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.