go-gtk
go-gtk copied to clipboard
Signal Connection Methods
I’m pretty new to GUI development, so string signals don’t seem to make much sense to me. I noticed that Buttons have a .Clicked (callback)
method which simply connects a callback to the “clicked” signal. This is really nice because it shows up in the godoc documentation and because there is no chance of compiling in a misspelled signal name.
I propose creating such methods in all widgets for all signals they emit so users can get documentation quickly and reduce the possibility for errors. Furthermore, I propose using a naming convention like ConnectClicked ()
or SignalClicked ()
so all signal-connection methods are obvious (I think this would be more friendly to noobs like me and to GTK veterans who are used to string-signal names).
Are there any problems with this proposal? Pros/cons?
Sounds good to me. Unfortunately its not a lot of people hacking on go-gtk these days. Maybe you want to do it?
I can definitely contribute toward the effort. I don't know if I can tackle the whole thing myself though. On Feb 14, 2013 3:56 PM, "Dag Robøle" [email protected] wrote:
Sounds good to me. Unfortunately its not a lot of people hacking on go-gtk these days. Maybe you want to do it?
— Reply to this email directly or view it on GitHubhttps://github.com/mattn/go-gtk/issues/148#issuecomment-13580919.