mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 04:45:13 +00:00
32 lines
No EOL
814 B
Text
32 lines
No EOL
814 B
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
|
|
export component A inherits Window {
|
|
mb := MenuBar {
|
|
}
|
|
MenuBar {
|
|
// ^error{Only one MenuBar is allowed in a Window}
|
|
}
|
|
|
|
Rectangle {
|
|
x: 45px;
|
|
}
|
|
Rectangle {
|
|
x: mb.absolute-position.x;
|
|
// ^error{Element 'MenuBar' does not have a property 'absolute-position'}
|
|
y: mb.height;
|
|
// ^error{Element 'MenuBar' does not have a property 'height'}
|
|
init => {
|
|
mb.focus();
|
|
// ^error{Element 'MenuBar' does not have a property 'focus'}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TESTS TODO
|
|
// - test that setting the window height sets it to the window height plus that of the menubar |