Hi,
I am trying to use fxruby to open a FileDialog multiple times through out the execution of the main ruby program which is not a GUI program. The main program executes, then there is a need to open a directory to pick a file and submit. And then pick another file and submit, so it is in a loop.
I see the following error: attempted to create more than one FXApp instance (RuntimeError)
To simplify my question, I am copying the following code.
If a user wanted to reopen the Hello World box twice in the same program once the first box is closed by clicking on the red (x) of the windows (upper right corner), how would he restart it again in the same program. I tried .exit, .destroy with subsequent object recreations and that did not work.
require 'fox16'
include Fox
class HelloWorld < FXMainWindow
def initialize(app)
super(app, "Hello, World!" , :width => 200, :height => 50)
end
def create
super
show(PLACEMENT_SCREEN)
end
end
app = FXApp.new
HelloWorld.new(app)
app.create
app.run
app.exit
HelloWorld.new(app)
app.create
app.run
Hi,
I am trying to use fxruby to open a FileDialog multiple times through out the execution of the main ruby program which is not a GUI program. The main program executes, then there is a need to open a directory to pick a file and submit. And then pick another file and submit, so it is in a loop.
I see the following error: attempted to create more than one FXApp instance (RuntimeError)
To simplify my question, I am copying the following code.
If a user wanted to reopen the Hello World box twice in the same program once the first box is closed by clicking on the red (x) of the windows (upper right corner), how would he restart it again in the same program. I tried .exit, .destroy with subsequent object recreations and that did not work.
require 'fox16'
include Fox
class HelloWorld < FXMainWindow
def initialize(app)
super(app, "Hello, World!" , :width => 200, :height => 50)
end
def create
super
show(PLACEMENT_SCREEN)
end
end
app = FXApp.new
HelloWorld.new(app)
app.create
app.run
app.exit
HelloWorld.new(app)
app.create
app.run