From: Richard Dale Date: 2004-09-29T21:44:23+09:00 Subject: Re: ruboids (on mac os) - singleton instance() returns nil? Michal 'hramrach' Suchanek wrote: > I get the expected behavior if I test with a simple class in irb but I > get non-singleton if I subclass Qt::Object. > .... > > Is it impossble to base singletons on QObject? > Yes, it looks as though that doesn't work. I changed it to a global variable $world instead: Params.readParamsFromFile(ARGV[0] || 'boids.properties') #world = World.instance $world = World.new win = WorldWindow.new() app.setMainWidget(win) $world.canvas = win.canvas win.show() $world.start() app.exec() But I had to make quite a few changes as well because the game is written in Ruby/Qt as opposed to QtRuby. So now I've got the camera dialog working, and the main window has a 'Quit' and a 'Camera' option. It doesn't seem to have any way to start the game though. I've emailed the current version to you. -- Richard