main.cpp 524 B

12345678910111213141516171819202122
  1. #include "TextEditorWidget.h"
  2. int main(int argc, char** argv)
  3. {
  4. GApplication app(argc, argv);
  5. auto* window = new GWindow;
  6. window->set_title("Text Editor");
  7. window->set_rect(20, 200, 640, 400);
  8. window->set_should_exit_event_loop_on_close(true);
  9. auto* text_widget = new TextEditorWidget();
  10. window->set_main_widget(text_widget);
  11. if (argc >= 2)
  12. text_widget->open_sesame(argv[1]);
  13. window->show();
  14. window->set_icon_path("/res/icons/TextEditor16.png");
  15. return app.exec();
  16. }