ladybird/Applications/TextEditor/main.cpp
Andreas Kling 841b2e5d13 WindowServer+LibGUI: Pass window icons as shared buffers rather than paths.
Now that we support more than 2 clients per shared buffer, we can use them
for window icons. I didn't do that previously since it would have made the
Taskbar process unable to access the icons.

This opens up some nice possibilities for programmatically generated icons.
2019-07-28 10:18:49 +02:00

22 lines
506 B
C++

#include "TextEditorWidget.h"
#include <LibDraw/PNGLoader.h>
int main(int argc, char** argv)
{
GApplication app(argc, argv);
auto* window = new GWindow;
window->set_title("Text Editor");
window->set_rect(20, 200, 640, 400);
auto* text_widget = new TextEditorWidget();
window->set_main_widget(text_widget);
if (argc >= 2)
text_widget->open_sesame(argv[1]);
window->show();
window->set_icon(load_png("/res/icons/TextEditor16.png"));
return app.exec();
}