[fxruby-users] Accessing SQLite database in FXRuby application

William B. Parsons wbparsons at cshore.com
Sat Feb 27 10:37:04 EST 2010


On Sat, 27 Feb 2010 09:34:04 -0500
Joey Kinsella <jkinsella at ancillaryservices.com> wrote:

> Try changing the following block:
> 
> TestApp.new do |app|
>   TopLevelWindow.new(app)
>   app.create
>   app.run
> end
> 
> to:
> 
> app = TestApp.new
> TopLevelWindow.new(app)
> app.create
> app.run
> 
> I think (but I could be mistaken) when you pass a block to FXApp.new it's
> more like this:
> 
> if block_given?
>   yield(FXApp.new(name, vendor))
> else
>   # ....
> end
> 
> If this is the case, then @db would never get initialized, since the
> overloaded initialized method would never be called.

Thanks!  That does indeed seem to be the case, so it looks like I have
a solution.

-- 
Will


More information about the fxruby-users mailing list