[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FXRuby multiple applications

pseudoman4

3/8/2006 12:59:00 PM

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

5 Answers

Gregor Kopp

3/8/2006 1:45:00 PM

0

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
> 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
>

pseudoman4

3/8/2006 3:44:00 PM

0

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 :(

Lyle Johnson

3/8/2006 7:07:00 PM

0

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:

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?


Vincenzo Piombo

3/8/2006 10:29:00 PM

0

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)
create_window(application)
application.create
application.run
end

start_fox_app




pseudoman4

3/9/2006 12:40:00 PM

0

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?