[fxruby-users] FXTable scrolling problem

Rovshan Baghirov rovshanb at gmail.com
Wed Aug 20 07:10:20 EDT 2008


I'm trying to accomplish the following task:

1) Query database for records
2) Populate FXTable with first 50 records from cursor
3) Populate more rows as the table scrolls down

To accomplish this I subclassed FXTable (class Table < FXTable) and defined
the initialize method as shown below:

def initialize(parent)
:padding => 2)
      setBackColor(FXRGB(255, 255, 255))
      setCellColor(1, 0, FXRGB(240, 255, 240))
      setCellColor(1, 1, FXRGB(240, 255, 240))

      verticalScrollBar.connect(SEL_COMMAND, method(:table_scrolled))

I also defined the table_scrolled method as below to check that the event
gets handled:

def table_scrolled(sender, selector, data)
      puts "table scrolled to #{data}"

Now when I start the application, populate the table with records (50
records) following happens:
- when I scroll the mouse wheel the scroll bar changes its position and I
get the output from the event handler but the records in table do not get
- the same happens when I click the scroll bar to change its position
- when I click on a table and start scrolling it using down arrow on
keyboard everything works ok, but this time the event handler does not get

Could you please, help me to fix this problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20080820/6e7be25c/attachment.html>

More information about the fxruby-users mailing list