wxWidgets based Stable Diffusion C++ GUi
Ferenc Szontágh
2024-02-05 126c3a3510a37e21c7404745144b5872b72aafdd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <wx/app.h>
#include <wx/event.h>
#include "MainWindowUi.h"
#include <wx/image.h>
 
// Define the MainApp
class MainApp : public wxApp
{
public:
    MainApp() {}
    virtual ~MainApp() {}
 
    virtual bool OnInit()
    {
        // Add the common image handlers
        wxImage::AddHandler(new wxPNGHandler);
        wxImage::AddHandler(new wxJPEGHandler);
        MainWindowUI *mainFrame = new MainWindowUI(nullptr);
        SetTopWindow(mainFrame);
        return GetTopWindow()->Show();
    }
};
 
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)