@@ -14,26 +14,33 @@ using namespace ruis::make;
1414}
1515
1616class application : public ruisapp ::application{
17+ ruisapp::window& window;
1718public:
1819 application () :
19- ruisapp::application (
20- " ruis-tests" ,
21- {
20+ ruisapp::application ({
21+ .name = " ruis-tests" }
22+ ),
23+ window (this ->make_window ({
2224 .dims = {1024 , 800 }
23- }
24- )
25+ }))
2526 {
26- this ->gui .init_standard_widgets (*this ->get_res_file (" ../../res/ruis_res/" ));
27+ this ->window .gui .context .get ().window ().close_handler = [this ](){
28+ this ->quit ();
29+ };
30+
31+ this ->window .gui .init_standard_widgets (*this ->get_res_file (" ../../res/ruis_res/" ));
32+
33+ auto ctx = this ->window .gui .context ;
2734
2835 // clang-format off
29- auto c = m::container (this -> gui . context ,
36+ auto c = m::container (ctx ,
3037 {
3138 .container_params {
3239 .layout = ruis::layout::trivial
3340 }
3441 },
3542 {
36- m::window (this -> gui . context ,
43+ m::window (ctx ,
3744 {
3845 .widget_params {
3946 .rectangle = {{200 , 200 }, {200 , 100 }}
@@ -44,14 +51,14 @@ class application : public ruisapp::application{
4451 .title = U" aspect ratio proxy" s
4552 },
4653 {
47- m::pile (this -> gui . context ,
54+ m::pile (ctx ,
4855 {
4956 .layout_params {
5057 .dims = {ruis::dim::min, ruis::dim::fill}
5158 }
5259 },
5360 {
54- m::aspect_ratio_proxy (this -> gui . context ,
61+ m::aspect_ratio_proxy (ctx ,
5562 {
5663 .layout_params {
5764 .dims = {ruis::dim::min, ruis::dim::fill}
@@ -61,7 +68,7 @@ class application : public ruisapp::application{
6168 }
6269 }
6370 ),
64- m::rectangle (this -> gui . context ,
71+ m::rectangle (ctx ,
6572 {
6673 .layout_params {
6774 .dims = {ruis::dim::fill, ruis::dim::fill}
@@ -71,7 +78,7 @@ class application : public ruisapp::application{
7178 }
7279 }
7380 ),
74- m::text (this -> gui . context ,
81+ m::text (ctx ,
7582 {},
7683 U" 1:2" s
7784 )
@@ -83,7 +90,7 @@ class application : public ruisapp::application{
8390 );
8491 // clang-format on
8592
86- this ->gui .set_root (c);
93+ this ->window . gui .set_root (c);
8794 }
8895};
8996
0 commit comments