The following isn''t working. I tried Fox::getApp(), FXId::getApp(),
FXWindow::getApp(), and on the FXRuby website I couldn''t find what
getApp() belonged to. On the FOX website, it said FXId. Assuming I''m
not passing the app into the method, and the file has no outside
information on what app might be using it, how do I getApp()?
require ''fox16''
include Fox
Class A
def initialize(filename)
@filename = filename
@icon = nil
end
def set_icon
File.open(@filename, ''rb'') do |file|
@icon = FXJPGIcon.new(FXId::getApp(), file.read, 0,
IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP)
end
end
end
On 3/27/07, Raj Sahae <rajsahae at gmail.com> wrote:> Assuming I''m not passing the app into the method, and the file has no outside > information on what app might be using it, how do I getApp()?The FXApp.instance() class method should do the trick: @icon = FXJPGIcon.new(FXApp.instance, ...) Note that you need to have actually constructed the FXApp prior to calling FXApp.instance; otherwise, it will return nil. Hope this helps, Lyle
> The FXApp.instance() class method should do the trick: > > @icon = FXJPGIcon.new(FXApp.instance, ...) > > Note that you need to have actually constructed the FXApp prior to > calling FXApp.instance; otherwise, it will return nil. > > Hope this helps, > > Lyle > ________That was exactly what I was looking for. Thanks Lyle. Raj