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

Allow for Symbols as well as Strings for .signal_connect() #104

Open
rubyFeedback opened this issue Sep 16, 2022 · 1 comment
Open

Allow for Symbols as well as Strings for .signal_connect() #104

rubyFeedback opened this issue Sep 16, 2022 · 1 comment

Comments

@rubyFeedback
Copy link

rubyFeedback commented Sep 16, 2022

Hey there,

Would it be possible to support:

button.signal_connect(:clicked) { win.destroy }

in addition to:

button.signal_connect('clicked') { win.destroy }

?

So both string, or symbol for signal connect as
argument. The symbol could be converted internally
in whatever code handles the signal-connect
situation. (I don't know how the gir bindings work,
whether you can make such modifications or
not.)

ruby-gtk3 allows both and I use the symbol variant,
since I can omit the trailing '

It is not important, but if it is of no bother to you or
the project here then I think I would like to be able
to use it. It may lead to less uniform downstream
code, so there is a trade-off, but personally I love
symbols for several reasons. Anyway it is just
a suggestion, it is your project so you are making
the decisions which is totally fine. Thank you for
reading!

@mvz mvz changed the title [Suggestion] Allow for Symbols as well as Strings for .signal_connect() ? Allow for Symbols as well as Strings for .signal_connect() ? Sep 18, 2022
@mvz
Copy link
Owner

mvz commented Sep 18, 2022

This could be nice since the resulting code will look better. One thing to take into account is that signal names use dashes to separate words. In symbols, underscores should probably be supported as an alternative.

@mvz mvz changed the title Allow for Symbols as well as Strings for .signal_connect() ? Allow for Symbols as well as Strings for .signal_connect() Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants