I've recently begun working a bit with FXRuby. While messing around with
the code for Tables, I found out that I cannot set individual cell
colors with FXTable::setCellColor . Now, looking at the API I noticed
that FXTableItem has an instance method called drawBackground, with the
parameters table, dc, x, y, w, h. I am assuming that dc is a FXDC
object, table the parent table of the FXTableItem in question, x and y
coordinated in pixels, and w and h width and height in pixels. So I
figured that I could possibly set individual cell color with something
along the lines of
@table.getItem( row, col ).drawBackground( @table, dc, x, y, w, h )
However, my attempts so far have been in vain. I've attempted to get x,
y, w, and h by using
@table.getColumnX( col ),
@table.getRowY( row ),
@table.getItem( row, col ).getWidth( @table ), and
@table.getItem( row, col ).getHeight( @table )
respectively. I wasn't sure what to use for dc, so I created a new FXDC
by using
dc = FXDC.new( self )
(which didn't work if I recall correctly). So my question is, is it even
possible to use FXTableItem.drawBackground or am I on a futile quest? If
it is possible, what should I use for dc?
|