go-gtk
go-gtk copied to clipboard
return from event(signal handler)
return value from signal handlers, it is work?
example:
somebody.Connect("signal", callback)
func callback(ctx *glib.CallbackContext) interface{} {
\* some code *\
return something
}
thx!
What is your expected? Which widget or event do you mean?
for example here: WebKitWebView-create-web-view
this signal handler should be return a new instance of webview
Currently, go-gtk suppor only bool return value.
https://github.com/mattn/go-gtk/blob/master/glib/glib.go#L813-L814
But I can fix this in feature.
Yes, I saw it, just wanted to be sure... I will try to to complete it, thx you.
i am don't know how to fix this without changing too much of code, in my opinion, easier to add separate function, something like: ConnectCreateWebView
for type webview in go-webkit package... but this is not correct way.
P.S. this condition does nothing: https://github.com/mattn/go-gtk/blob/master/glib/glib.go.h#L133-L138
Maybe last change will be something good for you.
Great! Thx!
I think the getWebView
function, package go-webkit should be public (ex: GetWebView), to be able to return C type of WebView from signal handler. example: https://github.com/sg3des/vegevoice/blob/master/browser_tabs.go#L84-L87
or is there another way?