func (s *Signal) DisconnectAll() {
	s.Mu.Lock()
	s.Cons = make(map[Ki]RecvFunc)
	s.Mu.Unlock()
}
DisconnectAll removes all connections
package ki
import (
	"fmt"
	"sync"
	"github.com/goki/ki/kit"
)
type NodeSignals int64
const (
	NodeSignalNil NodeSignals = iota
	NodeSignalUpdated
	NodeSignalDeleting
	NodeSignalsN
)
var SignalTrace bool = false
var SignalTraceString *string
type RecvFunc func(recv, send Ki, sig int64, data interface{})
type Signal struct {
	Cons map[Ki]RecvFunc `view:"-" json:"-" xml:"-" desc:"map of receivers and their functions"`
	Mu   sync.RWMutex    `view:"-" json:"-" xml:"-" desc:"read-write mutex that protects Cons map access -- use RLock for all Cons reads, Lock for all writes"`
}
var KiT_Signal = kit.Types.AddType(&Signal{}, nil)
func (s *Signal) ConnectOnly(recv Ki, fun RecvFunc) {
	s.DisconnectAll()
	s.Connect(recv, fun)
}
func (s *Signal) Connect(recv Ki, fun RecvFunc) {
	s.Mu.Lock()
	if s.Cons == nil {
		s.Cons = make(map[Ki]RecvFunc)
	}
	s.Cons[recv] = fun
	s.Mu.Unlock()
}
func (s *Signal) Disconnect(recv Ki) {
	s.Mu.Lock()
	delete(s.Cons, recv)
	s.Mu.Unlock()
}
func (s *Signal) DisconnectDestroyed(recv Ki) bool {
	if recv.IsDestroyed() {
		s.Mu.RUnlock()
		s.Disconnect(recv)
		s.Mu.RLock()
		return true
	}
	return false
}