Skip to content

Commit

Permalink
Merge pull request #934 from GuillaumeGomez/builder-doc
Browse files Browse the repository at this point in the history
Update builder documentation
  • Loading branch information
EPashkin committed Jun 19, 2020
2 parents 5a5b8f5 + 74ef367 commit da61d28
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,24 @@ manual = ["Gtk.Button"]

So in here, both `GtkWidget` and `GtkWindow` will be fully generated and functions/methods using `GtkButton` will be uncommented. To generate code for all global functions, add `Gtk.*` to the `generate` array.

To also generate a `Builder` struct for a widget, it needs to be added in the `builders` array or set `generate_builder` flag in object configuration:
To also generate a `Builder` struct for a widget, it needs to be set with the `generate_builder` flag in object configuration:

```toml
builders = [
"Gtk.AboutDialog", # generated object name
"Gtk.WindowBuilder", # or name with suffix Builder
]

[[object]]
name = "Gtk.TreeView"
status = "generate"
generate_builder = true
```

If you want to remove warning messages about the not bound `Builders` during the generation you don't want to be generated, you can ignore them with the `ignore_builder` flag in object configuration:

```toml
[[object]]
name = "Gtk.TreeView"
status = "generate"
ignore_builder = true
```

If there is some work which has to be done post-construction before the builder's
`build` method returns, you can set the `builder_postprocess` value in the object configuration:

Expand Down

0 comments on commit da61d28

Please sign in to comment.