Check
GTK window program77 lines of .st232 lines of generated C

The state of the button is 1 The state of the button is 0
On this page
The .st files#
intent.st
structop {
type_app {
exec = {
lang = "C"
}
}
lib_provider {
core = {
source = "StructOp/core"
version = "@latest"
}
Gui = {
source = "StructOp/gui"
version = "@latest"
}
}
}main.st
ability "app" "Gui" {
body = [ability.window.Main, ability.click.On, ability.click.Off]
exit_after = 500
}
ability "window" "Main" {
children = [ability.table.Grid]
on_close = [ability.quit.Closed]
}
ability "table" "Grid" {
rows = 2
columns = 2
homogeneous = true
children = [ability.label.Text, ability.check.Mine, ability.button.Close, ability.entry.Box]
}
ability "label" "Text" {
text = "My label"
cell = [0, 1, 0, 1]
}
ability "check" "Mine" {
label = "My check"
cell = [1, 2, 0, 1]
on_toggle = [ability.print.State]
}
ability "button" "Close" {
label = "Close window"
cell = [0, 1, 1, 2]
on_click = [ability.quit.Done]
}
ability "entry" "Box" {
cell = [1, 2, 1, 2]
}
data "active" "State" {
widget = ability.check.Mine
}
ability "print" "State" {
message = "The state of the button is ${int(data.active.State.active)}"
}
ability "click" "On" {
widget = ability.check.Mine
}
ability "click" "Off" {
widget = ability.check.Mine
}
ability "quit" "Done" {
}
ability "quit" "Closed" {
}Input, plan and generated C#
structop plan
structop plan
# program.app will be created
+ program.app (.structop/build/app)
+ ability.app.Gui
+ ability.window.Main
+ ability.table.Grid
+ ability.label.Text
+ ability.check.Mine
+ ability.button.Close
+ ability.entry.Box
+ ability.print.State
+ ability.click.On
+ ability.click.Off
+ ability.quit.Done
+ ability.quit.Closed
Plan: 1 to add, 0 to change, 0 to destroy.Generated main.c
To inspect this generated file, select C in intent.st, initialize the project and export its source.
Export locally
structop init
structop apply -source -no-runTry it
cd c-check # a folder holding the .st files above
structop init
structop plan
structop apply