main.cpp 525 B

1234567891011121314151617181920212223
  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. window->set_icon_path("/res/icons/TextEditor16.png");
  10. auto* text_widget = new TextEditorWidget();
  11. window->set_main_widget(text_widget);
  12. if (argc >= 2)
  13. text_widget->open_sesame(argv[1]);
  14. window->show();
  15. return app.exec();
  16. }