[fxruby-users] attaching tooltip to FXTable

William B. Parsons wbparsons at cshore.com
Tue May 18 16:54:22 EDT 2010


I'd like to attach a tooltop to an FXTable such that the text displayed will 
depend on where the mouse pointer is within the table.  After googling, it seems
the trick to associate a tooltip with a widget that doesn't already support it is:

connect(SEL_QUERY_TIP) do |sender, selector, data|
   sender.handle(self, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), 'XXXX')
end

The problem is how to replace 'XXXX' with text that depends on which cell the mouse
is hovering over.

I thought the first step might be to catch the mouse co-ordinates when the mouse 
moves, but the following does't seem to work, regardless of which window it's
attached to:

connect(SEL_MOTION) do |sender, selector, event|
   puts "#{event.win_x},#{event.win_y}"
end

-- 
Will


More information about the fxruby-users mailing list