i use FXRuby and try to start a applicattion twice with the following
code:
require "fox12.so"
include Fox
def start_fox_app
application = FXApp.new("FoxTest", "ruby")
application.init(ARGV)
window = FXMainWindow.new(application, "FOX", nil, nil, DECOR_ALL,
0, 0, 580, 500)
window.show(PLACEMENT_SCREEN)
application.create
application.run
end
start_fox_app
start_fox_app
The second call of "start_fox_app" leads to a segmentation fault. The
same thing
also occurs if i try to differenet apps
Any ideas why this can happen and how to prevent this behavior?
hth, Michael
start the scripts twice, or use a second window.
pseudoman4@yahoo.com schrieb:
···
i use FXRuby and try to start a applicattion twice with the following
code:
require "fox12.so"
include Fox
def start_fox_app
application = FXApp.new("FoxTest", "ruby")
application.init(ARGV)
window = FXMainWindow.new(application, "FOX", nil, nil, DECOR_ALL,
0, 0, 580, 500)
window.show(PLACEMENT_SCREEN)
application.create
application.run
end
start_fox_app
The second call of "start_fox_app" leads to a segmentation fault. The
same thing
also occurs if i try to differenet apps
Any ideas why this can happen and how to prevent this behavior?
hth, Michael
Well, you can't have more than one application instance in the same
process, so that's a problem. What is it that you're trying to
accomplish? Do you want multiple main windows or something?
···
On 3/8/06, pseudoman4@yahoo.com <pseudoman4@yahoo.com> wrote:
i use FXRuby and try to start a applicattion twice with the following
code:
the problem is that i want to embed to start_fox_app in c++.
so c++ opens a FXRuby GUI. starting the script twice (in the same c++
process)
does not solve the probelm 
I try to make a c++ application with a "open"-button allowing the user
to open an FXRuby window (to enrich the app with more interactivity).
If the window is closed (and the FXApp terminates) opening the same
window a second time via the "open"-button does not work.
So i want to restart the whole FXApp with one window. Another way would
be to make the window invisible when user tries to close it and make
visible again on "open"-button press.
Is this possible? Any ideas how to this or another solutions?
pseudoman4@yahoo.com ha scritto:
the problem is that i want to embed to start_fox_app in c++.
so c++ opens a FXRuby GUI. starting the script twice (in the same c++
process)
does not solve the probelm 
The following works, it opens two main windows ...
def create_window(application)
window = FXMainWindow.new(application, "FOX", nil, nil, DECOR_ALL,0, 0, 580, window.show(PLACEMENT_SCREEN)
end
def start_fox_app
application = FXApp.new("FoxTest", "ruby")
application.init(ARGV)
create_window(application)
application.create
application.run
end
start_fox_app