-
Notifications
You must be signed in to change notification settings - Fork 278
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (31 loc) · 981 Bytes
/
main.cpp
File metadata and controls
39 lines (31 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*=============================================================================
Copyright (c) 2016-2023 Joel de Guzman
Distributed under the MIT License (https://opensource.org/licenses/MIT)
=============================================================================*/
#include <elements.hpp>
using namespace cycfi::elements;
// Main window background color
auto constexpr bkd_color = rgba(35, 35, 37, 255);
auto background = box(bkd_color);
auto make_child_window(rect bounds, char const* title)
{
return closable_child_window(
title,
bounds,
scroller(image{"deep_space.jpg"})
);
}
int main(int argc, char* argv[])
{
app _app("Child Window");
window _win(_app.name());
_win.on_close = [&_app]() { _app.stop(); };
view view_(_win);
view_.content(
make_child_window({10, 10, 300, 200}, "Child Window 1"),
make_child_window({60, 60, 350, 250}, "Child Window 2"),
background
);
_app.run();
return 0;
}