布局测试
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
#include "window/mwindow.h"
|
||||
#include "font/font_system.h"
|
||||
#include "widget/widget_new.h"
|
||||
#include "widget/compound_widget/mbutton.h"
|
||||
#include "widget/leaf_widget/mtext_block.h"
|
||||
#include "widget/panel_widget/mbox.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
mirage_app::get().init();
|
||||
@@ -14,10 +16,28 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
const auto& text_block = std::make_shared<mtext_block>();
|
||||
text_block->set_text(U"Hello, World! 你好,世界!😀");
|
||||
// text_block->set_text(U"😀");
|
||||
|
||||
const auto& text_block2 = std::make_shared<mtext_block>();
|
||||
text_block2->set_text(U"Hello, World!");
|
||||
|
||||
const auto button = std::make_shared<mbutton>();
|
||||
button->set_content(text_block);
|
||||
|
||||
const auto button2 = std::make_shared<mbutton>();
|
||||
button2->set_content(text_block2);
|
||||
|
||||
const auto& window = mwindow::create({ 1024, 1024 }, L"Hello, World!");
|
||||
window->set_content(text_block);
|
||||
window->set_content(
|
||||
mnew(mh_box)
|
||||
mslot(mh_box)
|
||||
[
|
||||
button
|
||||
]
|
||||
mslot(mh_box)
|
||||
[
|
||||
button2
|
||||
]
|
||||
);
|
||||
|
||||
mirage_app::get().run();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user