| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | import {Button, AboutSlint} from "std-widgets.slint" ; |
| 5 | |
| 6 | export global Logic { |
| 7 | callback increment(int) -> int; |
| 8 | } |
| 9 | |
| 10 | export struct FooBar { |
| 11 | abc: int, def: string |
| 12 | } |
| 13 | |
| 14 | component R { |
| 15 | property <FooBar> foo; |
| 16 | Rectangle { |
| 17 | TouchArea {} |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export component App inherits Window { |
| 22 | preferred-width: 800px; |
| 23 | preferred-height: 600px; |
| 24 | property <int> count; |
| 25 | |
| 26 | VerticalLayout { |
| 27 | AboutSlint { } |
| 28 | Button { |
| 29 | text: "Hello" ; |
| 30 | clicked => { count = Logic.increment(count); } |
| 31 | } |
| 32 | Text { text: count; } |
| 33 | R { } |
| 34 | } |
| 35 | } |
| 36 | |