February 2019
Intermediate to advanced
450 pages
11h 59m
English
The previous examples all use a function with no parameters. While this is often enough, it can be helpful to pass additional information into your signal handling functions. This can be done easily as the connect functionality (mirrored by the Clicked() convenience function) allows for additional parameters to be sent. After the function reference, you can pass additional data parameters, which will be available to the function that executes the callback.
We can demonstrate that by creating a new button and passing this button along with the function to the signal connection:
button := gtk.NewButton()button.SetLabel(label)button.Clicked(clicked, button)
In the callback function, we update the function signature to accept a ...
Read now
Unlock full access