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
4component TextInner inherits Text {
5 callback panic();
6 //init => { self.panic() }
7 text: "Click me";
8 TouchArea {
9 clicked => { root.panic(); }
10 }
11}
12
13component TextOuter {
14 callback panic <=> inner.panic;
15 inner := TextInner {
16 width: 100%;
17 height: 100%;
18 }
19}
20
21export component TestCase inherits Window {
22 width: 300px;
23 height: 300px;
24 TextOuter {
25 }
26}
27
28/*
29```cpp
30auto handle = TestCase::create();
31const TestCase &instance = *handle;
32slint_testing::send_mouse_click(&instance, 50., 50.);
33```
34
35```rust
36let instance = TestCase::new().unwrap();
37slint_testing::send_mouse_click(&instance, 50., 50.);
38```
39
40```js
41var instance = new slint.TestCase();
42slintlib.private_api.send_mouse_click(instance, 50., 50.);
43```
44*/
45