-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorial – Container Interfaces
In addition to having Interfaces that are applied to the entire Application you can also load pre-specified interfaces in to any Container subclass.
The main situation of when you would want to do this is if you have created a Container subclass that always needs to have a certain interface. For example, the Window class uses this to load the close, minimise, etc. buttons and the title Label without any code.
Always avoid manually coding in interfaces in to your subclasses. It's messy, uses far more code than you would otherwise use and doesn't allow for easy modification or readability.
The usage for this is essentially identical to the method you use for ApplicationContainer interfaces; it uses most of the same code.
Simply set the interfaceName
property to the name of the interface file you want to use for your subclass.
Rather than using ApplicationContainer for the root node you will obviously need to use your Container subclass. You can also set properties that, unless overriden, will be used in when the Container is used in other interfaces.
class "ExampleContainer" extends "Container" {
interfaceName = "examplecontainer";
}
examplecontainer.sinterface
<ExampleContainer width=30 height=14>
<Button x=4 y=1 text="Hello"/>
</ExampleContainer>