slint/internal/compiler/tests/syntax/callbacks/init.slint
Simon Hausmann 907b58161c Add support for invoking an init callback on component and element construction
This enables imperative code to be run. To be used sparingly :-)
2022-11-17 10:12:08 +01:00

14 lines
415 B
Text

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
global Singleton := {
callback init;
// ^error{A global component cannot have an 'init' callback}
init => { debug("nope"); }
// ^error{A global component cannot have an 'init' callback}
}
Test := Rectangle {
callback init;
// ^error{Cannot override callback 'init'}
}