Re: [Fxruby-users] Icons and tooltips
Status: Inactive
Brought to you by:
lyle
From: Jamey C. <jc...@tw...> - 2004-05-23 15:16:40
|
I'm sure others, especially Lyle, can anwer these questions better than I can, but since we all want Lyle to be working on the next version of FXRuby instead of answering questions, I'll take a lame stab at some answers: :) Hal Fulton wrote: > Forwarding a question someone asked me. > RLMuller wrote: > >> 1. The syntax of the "FXPNGIcon.new(application, f.read)" statement >> would >> lead me to think the icon is being attached to the application (e.g., >> for >> purpose of displaying the app in an OS' toolbar when it runs, perhaps) >> rather than in the application's FXMainWindow instance. I'd expect >> it to >> have a "main" argument explicitly naming the window to which it >> should be >> attached, as FxButton.new does. >> FXPNGIcon.new isn't putting the icon into any particular widget, it is simply creating the icon so that it can later be put into one or more widgets or windows (i.e. button, dialogbox, etc.). That's why you don't specify the particular widget (i.e. button) when you initially create it. However, if you look in the docs for the FXButton class, you will see that you can specify an icon in the constructor. That's where you put the reference to the FXPNGIcon that you created earlier. Am I understanding the question or did I miss something? >> 2. FXTooltip.new's failure to name any particular object leads me to >> think >> it should wire a tooltip into every object in the application (or >> rather, >> the app's main window?) that's built to host a tooltip, and that the >> tooltip text is to be gotten from each such object's caption text (using >> everything following the first tab.) >> This is kind of the same thing. You initialize a FXTooltip object once for the entire application. Then, when you create each object (i.e. button), you can specify a text string in the constructor that will appear as the tooltip for that object. But you have toe create the FXTooltip first for the whole app in order for tooltips to work for each object. >> I could probably answer these questions myself if I could find >> documentation >> on these classes, but all I could find on this website is class >> hierarchies >> for the Fox classes. >> >> Could you point me to a source for documentation for the Fox classes >> that >> addresses my questions, or in lieu of that comment on my inferences >> above? > > A pretty good source for docs is at www.fxruby.org. Click on the "API" button. This will take you to definitions of all the FXRuby classes/methods/attributes. HTH. Jamey |