slint/internal/compiler/tests/syntax/elements/menubar2.slint
Olivier Goffart 5bd20def0e Experimental support for MenuBar
Introduces `MenuBar{ ... }` that can be put in a Window
2024-11-20 09:25:37 +01:00

30 lines
781 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 MyMenu inherits MenuBar {
// ^error{MenuBar can only be within a Window element}
}
export component A inherits Window {
MenuBar {
Rectangle {}
// ^error{MenuBar cannot have children elements}
x: 45px;
// ^error{Unknown property x in MenuBar}
width: 45px;
// ^error{Unknown property width in MenuBar}
entries: [];
init => {}
// ^error{'init' is not a callback in MenuBar}
}
Rectangle {
x: 45px;
MenuBar {
// ^error{MenuBar can only be within a Window element}
}
}
}