From c1dbad5fdf0560983e6c832eddded6f610eae94e Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 10 Feb 2022 19:49:06 +0800 Subject: ... --- demos/scroll_view/main.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'demos/scroll_view/main.cpp') diff --git a/demos/scroll_view/main.cpp b/demos/scroll_view/main.cpp index d859ce3a..b049a408 100644 --- a/demos/scroll_view/main.cpp +++ b/demos/scroll_view/main.cpp @@ -11,15 +11,14 @@ using cru::ui::controls::TextBlock; using cru::ui::controls::Window; int main() { - IUiApplication* application = cru::platform::bootstrap::CreateUiApplication(); + std::unique_ptr application( + cru::platform::bootstrap::CreateUiApplication()); - auto window = Window::Create(); + Window window; + ScrollView scroll_view; + window.AddChild(&scroll_view); - auto scroll_view = ScrollView::Create(); - - window->AddChild(scroll_view); - - auto text_block = TextBlock::Create( + TextBlock text_block( uR"([Verse 1] The snow glows white on the mountain tonight Not a footprint to be seen @@ -76,13 +75,12 @@ Let it go, let it go That perfect girl is gone Here I stand in the light of day Let the storm rage on! -The cold never bothered me anyway)"); - - text_block->SetSelectable(true); +The cold never bothered me anyway)", + true); - scroll_view->SetChild(text_block); + scroll_view.SetChild(&text_block); - window->GetWindowHost()->GetNativeWindow()->SetVisibility( + window.GetWindowHost()->GetNativeWindow()->SetVisibility( cru::platform::gui::WindowVisibilityType::Show); return application->Run(); -- cgit v1.2.3