Radio
GTK window program78 lines of .st227 lines of generated C

Button 1: 0, Button 2: 1
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.Pick, ability.print.States]
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.radio.One, ability.radio.Two, ability.button.Close, ability.entry.Box]
}
ability "radio" "One" {
label = "Button 1"
group = "choice"
cell = [0, 1, 0, 1]
}
ability "radio" "Two" {
label = "Button 2"
group = "choice"
cell = [1, 2, 0, 1]
}
ability "button" "Close" {
label = "Close window"
cell = [0, 1, 1, 2]
on_click = [ability.quit.Done]
}
ability "entry" "Box" {
cell = [1, 2, 1, 2]
}
ability "click" "Pick" {
widget = ability.radio.Two
}
data "active" "First" {
widget = ability.radio.One
}
data "active" "Second" {
widget = ability.radio.Two
}
ability "print" "States" {
message = "Button 1: ${int(data.active.First.active)}, Button 2: ${int(data.active.Second.active)}"
}
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.radio.One
+ ability.radio.Two
+ ability.button.Close
+ ability.entry.Box
+ ability.click.Pick
+ ability.print.States
+ 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-radio # a folder holding the .st files above
structop init
structop plan
structop apply