Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect signals from Builder objects #126

Closed
jwharm opened this issue Aug 31, 2024 · 0 comments
Closed

Connect signals from Builder objects #126

jwharm opened this issue Aug 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jwharm
Copy link
Owner

jwharm commented Aug 31, 2024

It would be nice to connect signals from Builder objects, like this:

var button = Button.builder()
    .setLabel("Close")
    .onClicked(window::close)
    .build();

This can be implemented in the base Builder class with a HashMap of signal names and callbacks, and after the new GObject has been constructed, it would iterate through the map and connect the signals to the callbacks.

Depends on #125 to be fixed first, because currently the SignalHandler object that is returned by the connect method (such as onClicked above) is the only available mechanism to disconnect the signal and free the allocated memory.

@jwharm jwharm added the enhancement New feature or request label Aug 31, 2024
@jwharm jwharm closed this as completed in 8de413d Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant