gir_ffi-gtk
gir_ffi-gtk copied to clipboard
Allow for Symbols as well as Strings for .signal_connect()
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!
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.