[fxruby-users] FXTable tooltips

Thomas, Jason M (Software) jmthomas at ball.com
Tue Aug 28 16:18:43 EDT 2007

This is exactly what I was looking for, thanks! I found it also works
for FXTabItems in a FXTabBook. My code looks like this:

tab = FXTabItem.new(@tabbook, "&#{name}", nil)
tab.connect(SEL_QUERY_TIP, method(:onTableTabMouseover))  

def onTableTabMouseover(sender, sel, ptr)
  sender.text = my_tab_text

It looks like to me you can connect a method to SEL_QUERY_TIP on just
about anything to override the tool tip text.


-----Original Message-----
From: Lyle Johnson [mailto:lyle.johnson at gmail.com] 
Sent: Tuesday, August 28, 2007 8:51 AM
To: Thomas, Jason M (Software)
Cc: fxruby-users at rubyforge.org
Subject: Re: [fxruby-users] FXTable tooltips

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}"

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,


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

More information about the fxruby-users mailing list