# RFC on cleaning Wx::App

**URL:** <https://www.ruby-forum.com/t/rfc-on-cleaning-wx-app/154373>\
**Category:** wxRuby\
**Created:** [November 28, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/rfc-on-cleaning-wx-app/154373 "2008-11-28T12:07:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 28, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/rfc-on-cleaning-wx-app/154373/1 "2008-11-28T12:07:17Z")

</div>

Hi,

I added a missing feature in Wx::App that let’s you handle in one place  
exceptions raised in any event handler (without exiting the main\_loop,  
so that these exceptions may be not fatal to the app).

At that time I found that the docs of Wx::App and the code itself are  
not in sync. I’m in the process of creating a ticket with a patch for  
this.

Before I complete the patch, I request some comments on these methods:  
#on\_fatal\_exception  
#on\_unhandled\_exception  
#on\_exception\_in\_main\_loop

As these methods are designed to deal with C++ exceptions, shouldn’t we  
simply %ignore them in wxRuby? (That’s my proposal)

Additionnaly, I found that App.i doesn’t %include “wxApp.h” at all, the  
class definition is inlined in App.i directly (at the end of file). So  
should we get rid of “wxApp.i” ?

Regards,

Pascal

---

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 29, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/rfc-on-cleaning-wx-app/154373/2 "2008-11-29T16:24:45Z")

</div>

Pascal H. wrote:

> I added a missing feature in Wx::App that let’s you handle in one place  
> exceptions raised in any event handler (without exiting the main\_loop,  
> so that these exceptions may be not fatal to the app).

That would be good. Ideally something that would work ruby-ishly - eg  
rescue.

This discussion is probably better on wxruby-dev.

> simply %ignore them in wxRuby? (That’s my proposal)

Yes.

> Additionnaly, I found that App.i doesn’t %include “wxApp.h” at all, the  
> class definition is inlined in App.i directly (at the end of file). So  
> should we get rid of “wxApp.i” ?

Probably not - the header files in swig/classes/include work as a list  
of the classes available, even if some of them aren’t used in building  
the wxruby library.

thanks  
alex
