]> Creatis software - creaImageIO.git/blob - src/BlockScopeWxApp.cpp
reindent
[creaImageIO.git] / src / BlockScopeWxApp.cpp
1 #include <BlockScopeWxApp.h>
2 #include <wx/wx.h>
3
4
5 class DummyWxApp : public wxApp
6 {
7 public:
8   bool OnInit( );
9   int  OnExit() { return true; }
10 };
11
12 IMPLEMENT_APP_NO_MAIN(DummyWxApp);
13
14
15 bool DummyWxApp::OnInit( )
16 {        
17 //  std::cout << "OnInit()"<<std::endl;
18   wxApp::OnInit();
19 #ifdef __WXGTK__
20   //See http://www.wxwindows.org/faqgtk.htm#locale
21   setlocale(LC_NUMERIC, "C");
22 #endif
23   return true;
24 }
25
26
27 BlockScopeWxApp::BlockScopeWxApp()
28 {
29   mNeedToUninitialize = false;
30   if (wxApp::GetInstance()==0)
31     {
32       wxApp::SetInstance(new DummyWxApp);
33       wxInitialize();
34       mNeedToUninitialize = true;
35     }
36 }
37
38 BlockScopeWxApp::~BlockScopeWxApp()
39 {
40   if (mNeedToUninitialize) wxUninitialize();
41 }
42
43
44  
45