go-gtk icon indicating copy to clipboard operation
go-gtk copied to clipboard

Signal Connection Methods

Open weberc2 opened this issue 12 years ago • 2 comments

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?

weberc2 avatar Feb 13 '13 18:02 weberc2

Sounds good to me. Unfortunately its not a lot of people hacking on go-gtk these days. Maybe you want to do it?

bytting avatar Feb 14 '13 21:02 bytting

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.

weberc2 avatar Feb 14 '13 22:02 weberc2