diff options
Diffstat (limited to 'demos/scroll_view')
-rw-r--r-- | demos/scroll_view/main.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
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<IUiApplication> 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(); |