|
|
@Neur1n One more note: your code was incomplete (missing headers, constructors, destructors) and there were some typos. I wonder how this code could compile. If you ask further questions in fltk.general, please try to post complete, compileable code so we can better help you.
I converted your files so I could compile the entire program with fltk-config --compile main.cpp :
// file: main.cpp
#include "app.h"
int main() {
App app(400, 300, "APP");
return Fl::run();
}
// file: app.h
#include <FL/Fl_Window.H>
class AppImpl {
public:
AppImpl(int w, int h, const char *title) {
this->m_win = new Fl_Window(w, h, title);
this->m_win->show();
}
~AppImpl() {
if (this->m_win) {
delete this->m_win;
this->m_win = nullptr;
}
}
private:
Fl_Window *m_win;
};
class App {
public:
App(int w, int h, const char *title) { m_impl = new AppImpl(w, h, title); }
~App(){};
private:
AppImpl *m_impl;
};
Hope this helps.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
[ Direct Link to Message ] | |
|
| |