[fxruby-users] getApp

Lyle Johnson lyle at lylejohnson.name
Thu Oct 30 16:45:24 EDT 2008


On Oct 30, 2008, at 2:34 PM, angico wrote:

> Does anybody know where I can find the getApp method? I'm trying to  
> call FXApp::beep when a user makes a mistake in an application, but  
> calling getApp.beep gives me

<snip>

The getApp() method is defined on the FXId class, which is way up in  
the class hierarchy and is an ancestor class for FXWindow and many  
other FXRuby classes. But you obviously need to have your hands on an  
instance of FXId or one of its subclasses to be able to call that  
method.

A more general option (and what I suspect you'll need to use) is to  
just call the FXApp.instance method, which returns the (single) FXApp  
instance, e.g.

	FXApp.instance.beep

Hope this helps,

Lyle

---
"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!
http://www.pragprog.com/titles/fxruby







More information about the fxruby-users mailing list