aboutsummaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-08 23:08:10 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-08 23:08:10 +0800
commit37d9a034013b4245a50c0d748dc83d2c3d136210 (patch)
tree3cee1be334acc4d917e9d6b3cbe3e03b653116ac /demos
parent0b0c32a1d688389c36f1847edf77af1fd7a2f9d7 (diff)
downloadcru-37d9a034013b4245a50c0d748dc83d2c3d136210.tar.gz
cru-37d9a034013b4245a50c0d748dc83d2c3d136210.tar.bz2
cru-37d9a034013b4245a50c0d748dc83d2c3d136210.zip
Fix windows dynamic lib build.
Diffstat (limited to 'demos')
-rw-r--r--demos/ScrollView/main.cpp4
-rw-r--r--demos/main/main.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/demos/ScrollView/main.cpp b/demos/ScrollView/main.cpp
index b049a408..c7b4d0d6 100644
--- a/demos/ScrollView/main.cpp
+++ b/demos/ScrollView/main.cpp
@@ -18,7 +18,7 @@ int main() {
ScrollView scroll_view;
window.AddChild(&scroll_view);
- TextBlock text_block(
+ auto text_block = TextBlock::Create(
uR"([Verse 1]
The snow glows white on the mountain tonight
Not a footprint to be seen
@@ -78,7 +78,7 @@ Let the storm rage on!
The cold never bothered me anyway)",
true);
- scroll_view.SetChild(&text_block);
+ scroll_view.SetChild(text_block.get());
window.GetWindowHost()->GetNativeWindow()->SetVisibility(
cru::platform::gui::WindowVisibilityType::Show);
diff --git a/demos/main/main.cpp b/demos/main/main.cpp
index d17f42ba..d574670d 100644
--- a/demos/main/main.cpp
+++ b/demos/main/main.cpp
@@ -45,12 +45,12 @@ int main() {
window.AddChild(&flex_layout);
- TextBlock text_block(u"Hello World from CruUI!", true);
- flex_layout.AddChild(&text_block);
+ auto text_block = TextBlock::Create(u"Hello World from CruUI!", true);
+ flex_layout.AddChild(text_block.get());
- TextBlock button_text_block(u"OK");
+ auto button_text_block = TextBlock::Create(u"OK");
Button button;
- button.SetChild(&button_text_block);
+ button.SetChild(button_text_block.get());
flex_layout.AddChild(&button);
TextBox text_box;