# Bug: FXTable: programmatic deselection doesn't work as expected

**URL:** <https://www.ruby-forum.com/t/bug-fxtable-programmatic-deselection-doesnt-work-as-expected/225136>\
**Category:** FXRuby\
**Created:** [December 16, 2012, 6:36pm UTC](https://www.ruby-forum.com/t/bug-fxtable-programmatic-deselection-doesnt-work-as-expected/225136 "2012-12-16T18:36:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 16, 2012, 6:36pm UTC](https://www.ruby-forum.com/t/bug-fxtable-programmatic-deselection-doesnt-work-as-expected/225136/1 "2012-12-16T18:36:15Z")

</div>

The next words were posted in the bug tracker of FXRuby, I also made it  
here, because I don’t get answer from the administrators.

Hello Lars and company. Was working with FXTable wdiget; what I want to  
acomplish is that the the table is read only but full full read only, I  
mean: the user can’t select any cell. Well I realized that it is not  
possible, so I’ve tried to look for another solutions, and none of them  
work for me. The one which put me close to the solution was: “when the  
user select a cell, then the robot deselect it”, something like this:

table.connect(SEL\_SELECTED) do |sender, selector, data|  
table.getItem(data.row, data.col).selected=(false)  
end

Well this is curious, what happen’ when you click a cell?: It becomes  
with a ‘SelBackColor’ blue, and it draw inside a kind of ‘stipple’:  
following points surrounding the inner cell. What happen when I did the  
previous resolution, well the ‘stipple’ is released, but not the blue  
‘SelBackColor’. So that’s a partial deselection, it should also release  
the blue color…  
I’ve tried also:

table.connect(SEL\_SELECTED) do |sender, selector, data|  
table.handle(table, SEL(SEL\_DESELECTED, FXTable::ID\_DESELECT\_ALL), data)  
end

neither work… hope you can response me, thank you guys.

---

<div class="post-metadata">

**Author:** ![DamiSSn\_MSG](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@DamiSSn\_MSG](https://www.ruby-forum.com/u/DamiSSn_MSG)\
**Post date:** [December 18, 2012, 12:17am UTC](https://www.ruby-forum.com/t/bug-fxtable-programmatic-deselection-doesnt-work-as-expected/225136/2 "2012-12-18T00:17:51Z")

</div>

Was not a bug, judging by the response of Jeroen, maintainer of Fox C++  
GUI, is expected to work that way. Nevertheless I did find the solution,  
thanks to T. Hemmer:

table.connect(SEL\_SELECTED) do |sender, selector, data|  
sender.killSelection  
end

Don’t know how it passed to me -.-!
