StructOp/gtk2
Build windows, forms and event handlers with GTK 2.
COfficial providerPublished by StructOp
Use this provider
Add this declaration to your project and run structop init. Registry access and version locks
intent.st
structop {
type_app { exec = { lang = "C" } }
lib_provider {
core = { source = "StructOp/c", version = "@latest" }
package = { source = "StructOp/gtk2", version = "2.0.2" }
}
}
Example
Select a row in a GTK 2 tree view
Provider types
| Type | Kind | Values or native type |
|---|
Widget | handle | GtkWidget * |
Store | handle | GtkListStore * |
Icon | handle | GdkPixbuf * |
Builder | handle | GtkBuilder * |
Declaration reference
ability "app"
| Name | Type | Use |
|---|
| body | AbilityList | Required |
| exit_after | Expression Int | Optional |
ability "window"
| Name | Type | Use |
|---|
| title | String | Optional · plain = true |
| size | ExpressionList | Optional · count = 2 |
| children | AbilityList | Optional · max = 1 |
| on_close | AbilityList | Optional · handler = true |
| keep_open | Expression Bool | Optional |
ability "button"
| Name | Type | Use |
|---|
| label | String | Required · plain = true |
| on_click | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
| relief | Keyword | Optional |
| use_underline | Expression Bool | Optional |
ability "box"
| Name | Type | Use |
|---|
| direction | Keyword | Required |
| spacing | Expression Int | Optional |
| homogeneous | Expression Bool | Optional |
| children | AbilityList | Optional |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "label"
| Name | Type | Use |
|---|
| text | String | Optional · plain = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
| angle | Expression Float | Optional |
ability "set_text"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| text | String | Required |
ability "click"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
ability "table"
| Name | Type | Use |
|---|
| rows | Expression Int | Required |
| columns | Expression Int | Required |
| homogeneous | Expression Bool | Optional |
| children | AbilityList | Optional |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "entry"
| Name | Type | Use |
|---|
| text | String | Optional · plain = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "spin"
| Name | Type | Use |
|---|
| value | Expression Int | Required |
| min | Expression Int | Required |
| max | Expression Int | Required |
| step | Expression Int | Required |
| digits | Expression Int | Optional |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "check"
| Name | Type | Use |
|---|
| label | String | Required · plain = true |
| active | Expression Bool | Optional |
| on_toggle | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "radio"
| Name | Type | Use |
|---|
| label | String | Required · plain = true |
| active | Expression Bool | Optional |
| on_toggle | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "list_store"
No attributes.
ability "add_row"
| Name | Type | Use |
|---|
| store | Expression Store | Required |
| values | ExpressionList | Required |
ability "combo_text"
| Name | Type | Use |
|---|
| options | ExpressionList | Required |
| active | Expression Int | Optional |
| on_change | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "combo"
| Name | Type | Use |
|---|
| model | Expression Store | Required |
| show | Expression Int | Required |
| sort | Keyword | Optional |
| active | Expression Int | Optional |
| on_change | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "select"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| index | Expression Int | Required |
ability "load_icon"
| Name | Type | Use |
|---|
| name | String | Required · plain = true |
| size | Expression Int | Required |
| target | VarRef Icon | Required |
ability "tree_view"
| Name | Type | Use |
|---|
| model | Expression Store | Required |
| columns | AbilityList | Optional |
| on_select | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "view_column"
| Name | Type | Use |
|---|
| title | String | Required · plain = true |
| show | Expression Int | Required |
ability "select_row"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| index | Expression Int | Required |
ability "activate"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| after | Expression Int | Optional |
ability "dialog"
| Name | Type | Use |
|---|
| title | String | Required · plain = true |
| parent | Expression Widget | Optional |
| buttons | ExpressionList String | Required |
| children | AbilityList | Optional |
| target | VarRef Int | Optional |
| answer | Expression Int | Optional |
| answer_after | Expression Int | Optional |
ability "file_button"
| Name | Type | Use |
|---|
| title | String | Required · plain = true |
| action | Keyword | Required |
| on_set | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "file_dialog"
| Name | Type | Use |
|---|
| title | String | Required · plain = true |
| action | Keyword | Required |
| parent | Expression Widget | Optional |
| buttons | ExpressionList String | Required |
| target | VarRef Int | Optional |
| file | VarRef String | Optional |
| accept | Expression Int | Optional |
| base | Expression Bool | Optional |
| answer | Expression Int | Optional |
| answer_after | Expression Int | Optional |
| answer_name | String | Optional · plain = true |
ability "color_button"
| Name | Type | Use |
|---|
| color | String | Optional · plain = true |
| on_set | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "font_button"
| Name | Type | Use |
|---|
| font | String | Optional · plain = true |
| on_set | AbilityList | Optional · handler = true |
| expand | Expression Bool | Optional inside box |
| fill | Expression Bool | Optional inside box |
| padding | Expression Int | Optional inside box |
| cell | ExpressionList | Required inside table · count = 4 |
ability "choose_file"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| path | String | Required · plain = true |
ability "emit"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| signal | Keyword | Required |
ability "load_layout"
| Name | Type | Use |
|---|
| file | String | Required · plain = true |
| target | VarRef Builder | Required |
ability "connect"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| signal | Keyword | Required |
| run | AbilityList | Required · handler = true |
ability "show"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
ability "quit"
No attributes.
ability "close"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
ability "set_label"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| label | Expression String | Required |
data "event"
| Name | Type | Use |
|---|
| of | AbilityRef | Required |
| widget | Widget | Return value |
data "label"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| text | String | Return value |
data "text"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| text | String | Return value |
data "number"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| value | Int | Return value |
data "active"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| active | Bool | Return value |
data "selected"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| column | Expression Int | Optional |
| index | Int | Return value |
| text | String | Return value |
| value | String | Return value |
| row | String | Return value |
data "color"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| red | Int | Return value |
| green | Int | Return value |
| blue | Int | Return value |
data "font"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| font | String | Return value |
data "filename"
| Name | Type | Use |
|---|
| widget | Expression Widget | Required |
| base | Expression Bool | Optional |
| filename | String | Return value |
data "widget"
| Name | Type | Use |
|---|
| layout | Expression Builder | Required |
| id | String | Required · plain = true |
| widget | Widget | Return value |