[fxruby-users] [Foxgui-users] Stopping a FOX popup window

Thomas, Jason M (Software) jmthomas at ball.com
Wed Dec 5 10:49:29 EST 2007

That worked great! I'm just curious why I was going down the wrong path.
Was it because I called runPopup with a FXMainWindow? Does runPopup only
work with a FXPopup? When should FXApp.stop be called?

I tried the following:
  popup = FXPopup.new(window)
  popup.popup(nil, 0, 0)

At this point the popup window appeared. Then in my other thread I did:
  app = FXApp.instance

This results in a Segmentation fault. Any ideas?

Thanks again for helping me. Right now I'm just trying to understand how
FOX works.


-----Original Message-----
From: Lyle Johnson [mailto:lyle at lylejohnson.name] 
Sent: Wednesday, December 05, 2007 8:31 AM
To: Thomas, Jason M (Software)
Cc: foxgui-users at lists.sourceforge.net; fxruby-users at rubyforge.org
Subject: Re: [Foxgui-users] Stopping a FOX popup window

On 12/4/07, Thomas, Jason M (Software) <jmthomas at ball.com> wrote:

> I'm using the FXRuby bindings to FOX and trying to use the unit test 
> framework to do some testing. I've been able to create and tear down 
> my FOX applications successfully but I'm having trouble 
> programmatically closing a dialog box. I've tried (FXApp) stop and 
> stopModal but they don't seem to have any effect. Closing and 
> destroying the window works but the code is still stuck in the
application loop.

Your code doesn't create a dialog box, it creates a second main window.
Is that what you meant to do?

At any rate, you should be able to break out of the runPopup() loop by
calling hide() on the window:

  def test_exception_popup()
    Thread.new do
      app = FXApp.instance

Hope this helps,


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

More information about the fxruby-users mailing list