freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FR-devel] Re: FR UI problem with 2 windows - More news


From: Laurent Julliard
Subject: [FR-devel] Re: FR UI problem with 2 windows - More news
Date: Wed, 12 Jun 2002 22:49:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

Rich, Curt,

So I have spent some more time on this 2 windows problem because it was a bit enerving :-) So here is what I have discovered

A) First thing first: looping through @app.runWhileEvents(self) is definitely not equivalent to @app.run. A quick look at FXApp.cpp in the FOX source code shows that the runWhileEvents call works in modal mode on the window passed as an argument. It means that any events associated with a window that is not a child of the main window will never make it in the event queue. So much for the hack :-((

B) I'm not sure I fully understand the threading issue with FXRuby. I have made some modification to the code that makes FXRuby on Linux perfectly happy and I'd like to have your opinion on it and also you tell me why it doesn't work on a mswin build

In foxhacks.rb the messagepump now looks like this

    # This is called from FreeBASE Core
    @plugin["/system/ui/messagepump"].set_proc  do
      @app.run
      @plugin["/system/shutdown"].call(1)
    end

and in freebase/core.rb the two hacks have been commented and replaced with

tui = Thread.new {
        @bus["/system/ui/messagepump"].call()
      }
tui.join

With these 2 modifications my Databus Inspector window works perfectly well and the main FR window as well. Everything seems to be working fine.

So what I did basically is that I started a UI thread which enters app.run as soon as it starts and when the call to app.run exits it means the FOX app received a ID_QUIT message and we must properly shutdown the entire application. Hence the call to the shutdown slot.

It is so simple that I really wonder if I did not miss something. Curt is this how you did things first before you had to make the hack to work around the mswin problem? If not could you try my version with your mswin version and see if it works?

In case it still doesn't work on mswin I suggest we use the CONFIG hash (in rbconfig) to determine at run time on which type of Ruby build we are running and apply the hack accordingly? Which entry in the CONFIG hash should I use by the way to determine if I am on mswin or cygwin ?

Comments welcome

Laurent







reply via email to

[Prev in Thread] Current Thread [Next in Thread]