How can I dynamically figure out all of the available layout options for any given widget. I can scrape the RDocs for options available to just that widget, but each widget inherits more from the hierarchy - right? -Rich
On Apr 23, 2005, at 2:27 PM, me lyman wrote:> How can I dynamically figure out all of the available layout options > for any given widget. > > I can scrape the RDocs for options available to just that widget, but > each widget inherits more from the hierarchy - right?Well, if by "dynamically figure out" you mean some sort of method you can call on an object at runtime, there''s no way to do that; you definitely have to consult the documentation. You are correct that the options (layout and otherwise) available for a particular widget include all of the options available for objects of its ancestor classes. For example, a label (an instance of the FXLabel class) has certain label-specific options (e.g. how the text is justified inside the label, or how the label''s text is positioned relative to the label''s icon), but since FXLabel is a subclass of FXFrame, you also have the frame decoration options at your disposal (e.g. sunken or raised frames, frame thickness, etc.)
On Apr 23, 2005, at 9:25 PM, Richard Lyman wrote:> Maybe this will get me to where I''m going: > How can I figure out the inheritance chain? > > I''m guessing that the only thing available for 1.2 is here: > http://www.fox-toolkit.org/ref12/hierarchy.html > > ... and I''m guessing that FXRuby holds to that same inheritance.Yes, the FXRuby classes'' inheritance chain is the same as that for the FOX classes.> Am I guessing correctly? I can just write a script to parse that page > and derive the inheritance if FXRuby sticks to it...Sure, that should work. You might also be able to write a clever little Ruby program to figure it out for you since you can ask Ruby classes about their superclass, e.g. superclassOfLabel = Fox::FXLabel.superclass # should return Fox::FXFrame Anyways, hope this helps, Lyle
Hello list, I''m having trouble getting hotkeys to work in FXRuby. For my app, or at least a window, can I define a global hotkey for it so that I could ,say, press F5 and run some function? I''ve messed with FXAccelTable and looked all over the place, but I still can''t get them to work. Anyone have a working example? Thanks. See ya, -- _/ _/ _/ Jacob Hanson _/ _/_/_/ mailto:jacdx@jacobhanson.com _/_/_/ _/ _/ http://www.jacobhanson.com
On Apr 24, 2005, at 7:04 PM, Jacob Hanson wrote:> I''m having trouble getting hotkeys to work in FXRuby. For my app, or > at least a window, can I define a global hotkey for it so that I could > ,say, press F5 and run some function? I''ve messed with FXAccelTable > and looked all over the place, but I still can''t get them to work. > Anyone have a working example?The datatarget.rb program in the "examples" directory of the FXRuby distribution provides one such example. Take a look around line 175: # Install an accelerator self.accelTable.addAccel(fxparseAccel("Ctl-Q"), getApp(), FXSEL(SEL_COMMAND, FXApp::ID_QUIT)) and change the text in the call to fxparseAccel() to some other accelerator key, e.g. self.accelTable.addAccel(fxparseAccel("F5"), getApp(), FXSEL(SEL_COMMAND, FXApp::ID_QUIT)) This says that when the user presses the F5 key, the accelerator table will send a message with type SEL_COMMAND and identifier FXApp::ID_QUIT to the application object (which is returned by the call to getApp). In your case you''ll probably want to send some other message to some other object. Hope this helps, Lyle