1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
3 | |
4 | component TextInner inherits Text { |
5 | callback panic(); |
6 | //init => { self.panic() } |
7 | text: "Click me" ; |
8 | TouchArea { |
9 | clicked => { root.panic(); } |
10 | } |
11 | } |
12 | |
13 | component TextOuter { |
14 | callback panic <=> inner.panic; |
15 | inner := TextInner { |
16 | width: 100%; |
17 | height: 100%; |
18 | } |
19 | } |
20 | |
21 | export component TestCase inherits Window { |
22 | width: 300px; |
23 | height: 300px; |
24 | TextOuter { |
25 | } |
26 | } |
27 | |
28 | /* |
29 | ```cpp |
30 | auto handle = TestCase::create(); |
31 | const TestCase &instance = *handle; |
32 | slint_testing::send_mouse_click(&instance, 50., 50.); |
33 | ``` |
34 | |
35 | ```rust |
36 | let instance = TestCase::new().unwrap(); |
37 | slint_testing::send_mouse_click(&instance, 50., 50.); |
38 | ``` |
39 | |
40 | ```js |
41 | var instance = new slint.TestCase(); |
42 | slintlib.private_api.send_mouse_click(instance, 50., 50.); |
43 | ``` |
44 | */ |
45 | |