Module 3 – Compose a user interface you can describe
Build a tree of widgets
The released UI model supplies Text, Button, and Column. A column contains child widgets. A text widget holds a value; a button holds a label. This is a data description of an interface. Read the structure from the outside inward: one column, then two children in the listed order.
import agila
fn main() {
view := agila.Column{
children: [
agila.Text{value: 'Today: understand one function'},
agila.Button{label: 'Begin practice'},
]
}
agila.preview(view)
}The current preview function prints [Agila SDK sandbox UI] Column(2 children). It calls the top-level widget's describe() method. It does not recursively print every child or open a rendered window. Before running, predict how the output changes if you add a third child.
Reference: Agila SDK: sdk/agila/ui.fv and examples/ui_demo/main.fv.
Complete this lesson
Answer every check correctly to earn your lesson certificate. Feedback helps you review and try again.
Sign in · Save your progress and earn a certificate for this lesson.