[fxruby-users] uneditable FXTable cell

Lyle Johnson lyle.johnson at gmail.com
Sat Aug 18 13:01:47 EDT 2007

On Aug 17, 2007, at 3:12 PM, Thomas, Jason M ((Software)) wrote:

> I'd like to be able to set an individual FXTable cell to  
> uneditable. I tried using disableItem() but this didn't seem to  
> have any affect on whether you could select or change things. I've  
> also tried various things like registering handlers for  
> SEL_COMMAND, SEL_CHANGED, and SEL_SELECTED but that was getting  
> annoying and it still doesn't account for someone just pressing a  
> key and changing a value. I saw I could also handle SEL_KEYPRESS  
> but since that returns a FXEvent rather than a FXTablePos it looked  
> like it was going to be a lot of work to figure out where I was in  
> the table when the keypress occurred.

You're right; this looks like a bug in FOX. FOX doesn't respond to  
keypress events or single mouse button clicks on disabled table  
cells, but it does allow you to (among other things) double-click in  
a disabled cell and edit its contents. I am Cc'ing Jeroen on this to  
see if this can be fixed in FOX 1.6. Don't know if he has fixed this  
in FOX 1.7 yet.

>  I'd also like to know if there is any way to set the background of  
> my uneditable cell gray. I saw the stipple variable which I set but  
> FXTable renders the stipple color as bright red. That is the  
> opposite of the grey color I'd like to make it to indicate my value  
> is uneditable.

Yep, the default stipple color for FXTable is red (not sure why that  
was the choice). How does it look for you if you use the STIPPLE_GREY  
pattern and set the table's stipple color to, say, black?

	table.stippleColor = "black"
	table.getItem(3, 4).stipple = STIPPLE_GREY

Let's see if that works any better for you.

Hope this helps,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070818/fb17162a/attachment-0001.html 

More information about the fxruby-users mailing list