I need to know how to write a custom signal in GoGtk3. Having a gui thread wherein gtk is working in, I want to update a textview from adjacent goroutine.
label,_:= gtk.LabelNew()
go func(){
// This is listening to a websocket
//update label
for {
c.ReadJSON(&frame) // c is my gorilla websocket
fmt.Printf("I received something %v
", frame)
// label.SetText("update ...") is not working properly
}
}()
When using label.SetText method, I noticed that this is not working correctly. I suspect this is not thread safe and I should emit a signal instead. I appreciate if you lead me how.