34 lines
812 B
C++
34 lines
812 B
C++
//
|
|
// Created by Administrator on 25-2-26.
|
|
//
|
|
|
|
#include "mirage.h"
|
|
#include "core/window/mwindow.h"
|
|
#include "widget/compound_widget/mbutton.h"
|
|
#include "widget/panel_widget/mbox.h"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
mirage_app app;
|
|
app.init();
|
|
|
|
auto window = std::make_shared<mwindow>();
|
|
window->create_window(800, 600, L"Hello, World!");
|
|
window->show();
|
|
|
|
mirage_app::get_render_context()->setup_surface(window.get());
|
|
widget_manager::get().init_window(window);
|
|
|
|
auto weak_vbox = widget_manager::get().new_widget<mv_box>(window.get());
|
|
auto vbox = weak_vbox.lock();
|
|
|
|
vbox->add_slot<mbutton>().margin({ 5 });
|
|
vbox->add_slot<mbutton>().margin({ 5 }).stretch(1);
|
|
vbox->add_slot<mbutton>().margin({ 5 });
|
|
vbox->add_slot<mbutton>().margin({ 5 });
|
|
|
|
window->set_content(vbox);
|
|
|
|
app.run();
|
|
return 0;
|
|
}
|