Re: [Fxruby-users] Tooltips
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-04-03 03:18:05
|
On Mar 30, 2004, at 7:52 PM, Daniel Sheppard wrote: > Is it possible to add Tooltips to an FXCanvas? Is it true that the stock FXCanvas doesn't support tooltips, but we can get around that with a subclass of FXCanvas: require 'fox' require 'fox/responder' include Fox class TooltipCanvas < FXCanvas include Responder attr_accessor :tipText def initialize(*args) # Initialize base class super # Default tooltip self.tipText = "Canvas" # Listen for query messages from the tooltip FXMAPFUNC(SEL_UPDATE, FXWindow::ID_QUERY_TIP, :onQueryTip) end def onQueryTip(sender, sel, ptr) sender.text = tipText return 1 end end You should be able to use this one in place of a normal canvas, and set its tooltip message with the tipText accessor. Hope this helps, Lyle |