# FXRuby table and color questions

**URL:** <https://www.ruby-forum.com/t/fxruby-table-and-color-questions/178707>\
**Category:** Ruby\
**Created:** [November 9, 2009, 8:39pm UTC](https://www.ruby-forum.com/t/fxruby-table-and-color-questions/178707 "2009-11-09T20:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 9, 2009, 8:39pm UTC](https://www.ruby-forum.com/t/fxruby-table-and-color-questions/178707/1 "2009-11-09T20:39:13Z")

</div>

Hi people!

Does the Fox toolkit support partial transparency? None of the  
documentation I read mentions it  
explicitly, but there’s this page here:  
[http://www.fxruby.org/doc/ch03s05.html](http://www.fxruby.org/doc/ch03s05.html) showing (at the bottom) the  
really ugly  
results of binary-mask type transparency.

Also, is it possible to give different background colours to each cell  
in a FXTable? The documentation seems to  
skirt past this issue with a setCellColor function which only provides  
for global shading of every second row/col.  
Maybe I am missing something obvious?

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 9, 2009, 10:51pm UTC](https://www.ruby-forum.com/t/fxruby-table-and-color-questions/178707/2 "2009-11-09T22:51:30Z")

</div>

On Mon, Nov 9, 2009 at 1:38 PM, Leslie V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Does the Fox toolkit support partial transparency?

Not as far as I know.

When you assign an icon image to a widget (usually a label or button),  
FOX will honor any regions identified as fully transparent in the  
image. For PNGs, it uses the alpha channel to identify regions where  
alpha is zero; for other image types it can guess the transparent  
color or you can specify it explicitly.

> Also, is it possible to give different background colours to each cell  
> in a FXTable? The documentation seems to  
> skirt past this issue with a setCellColor function which only provides  
> for global shading of every second row/col.  
> Maybe I am missing something obvious?

You aren’t missing anything. All you can achieve with the table, short  
of maybe subclassing it and overriding the drawing behavior, is set  
alternating cell colors.

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 11, 2009, 12:17pm UTC](https://www.ruby-forum.com/t/fxruby-table-and-color-questions/178707/3 "2009-11-11T12:17:50Z")

</div>

On Mon, Nov 9, 2009 at 11:51 PM, Lyle J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> color or you can specify it explicitly.
> 
> > Also, is it possible to give different background colours to each cell  
> > in a FXTable? The documentation seems to  
> > skirt past this issue with a setCellColor function which only provides  
> > for global shading of every second row/col.  
> > Maybe I am missing something obvious?
> 
> You aren’t missing anything. All you can achieve with the table, short  
> of maybe subclassing it and overriding the drawing behavior, is set  
> alternating cell colors.

Ok, thanks!  
It’s kinda maddening how the docs for setCellColor don’t say: “by the  
way, directly  
controlling cell background color is impossible”!

BTW: when I first tried Fox a few years back I dismissed it because I  
got a few  
segmentation faults when I tried simple things, but I have been able  
to do some really  
nice forms in the last couple of days with it. Thanks for all your  
efforts with FXRuby!
