[fxruby-users] FXTable tooltips

Lyle Johnson lyle.johnson at gmail.com
Tue Aug 28 10:50:47 EDT 2007


On Aug 27, 2007, at 11:00 AM, Thomas, Jason M ((Software)) wrote:

> My FXTable appears to support tooltips because when I mouse over a
> column or row header it pops up the same text in the header itself.  
> How
> do I set this text to my own custom value?

There's not a convenient way to do this in FXRuby 1.6, but I just  
tried this and it seems to work:

     # Override default tooltips for the column header
     table.columnHeader.connect(SEL_QUERY_TIP) do |sender, sel, ptr|
       x, y, btns = table.columnHeader.getCursorPosition()
       index = table.columnHeader.getItemAt(x)
       if index >= 0 && index < table.columnHeader.numItems
         sender.text = "tooltip text for item #{index}"
       end
     end

If you're doing it for the row header, be sure to call getItemAt(y)  
instead of getItemAt(x). Per Jeroen, this should be much more  
straightforward in FOX and FXRuby 1.8.

Hope this helps,

Lyle


More information about the fxruby-users mailing list