diff options
author | crupest <crupest@outlook.com> | 2018-11-10 16:36:23 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-11-10 16:36:23 +0800 |
commit | a46c8d05392cf07c4897f9856e35bcd3f2382b25 (patch) | |
tree | d0c26b2fdddb22f1d59922701fcb7ec7c0df67f1 /src/main.cpp | |
parent | 6cc74c662b862599141a624af74a4d5b2881321d (diff) | |
download | cru-a46c8d05392cf07c4897f9856e35bcd3f2382b25.tar.gz cru-a46c8d05392cf07c4897f9856e35bcd3f2382b25.tar.bz2 cru-a46c8d05392cf07c4897f9856e35bcd3f2382b25.zip |
Add parent window constructor.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 264b3c7c..359b511b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,6 +87,8 @@ int APIENTRY wWinMain( //test 2 + Window child_window(&window); + const auto layout = CreateWithLayout<LinearLayout>(LayoutSideParams::Exactly(500), LayoutSideParams::Content()); layout->mouse_click_event.AddHandler([layout](cru::ui::events::MouseButtonEventArgs& args) @@ -114,7 +116,11 @@ int APIENTRY wWinMain( { const auto button = Button::Create(); button->GetLayoutParams()->padding = Thickness(20, 5); - button->AddChild(TextBlock::Create(L"button")); + button->AddChild(TextBlock::Create(L"Show child window.")); + button->mouse_click_event.AddHandler([&child_window](auto) + { + child_window.Show(); + }); layout->AddChild(button); } @@ -170,6 +176,7 @@ int APIENTRY wWinMain( window.AddChild(linear_layout); */ + window.Show(); return application.Run(); |