Ejemplo n.º 1
0
func (h *evtHandler) QueueEvent(event Event) {
	p := wxPtr(h)
	if p == nil {
		return
	}
	event.unhold()
	C.wxEvtHandler_QueueEvent(p, C.WxObjectPtr(wxPtr(event)))
}
Ejemplo n.º 2
0
func (h *evtHandler) QueueEvent(event Event) {
	p := ptr(h)
	if p == nil {
		return
	}
	globalObjectTable.unhold(event)
	C.wxEvtHandler_QueueEvent(p, C.WxObjectPtr(ptr(event)))
}
Ejemplo n.º 3
0
func (t *objectTable) Bind(ptr unsafe.Pointer, del func(unsafe.Pointer), hold bool) (id uint16) {
	var entryForDebug *objectTableEntry
	func() {
		t.l.Lock()
		defer t.l.Unlock()
		entry, exists := t.entries[ptr]
		if exists {
			id = entry.Id()
			entry.SetRef(entry.Ref() + 1)
			if DebugObjectBind {
				entryCopy := *entry
				entryForDebug = &entryCopy
			}
			if hold {
				entry.SetHeld(true)
			}
		} else {
			entry = &objectTableEntry{
				del: del,
			}
			entry.SetRef(1)
			entry.SetHeld(hold)
			id = t.NextId()
			entry.SetId(id)
			t.entries[ptr] = entry
			if DebugObjectBind {
				entryCopy := *entry
				entryForDebug = &entryCopy
			}
		}
	}()
	if entryForDebug != nil {
		log.Printf("[B] Bind 0x%x(%v)  \t%s Want to hold: %v\n", ptr, wxPtrTypeName(C.WxObjectPtr(ptr)), entryForDebug, hold)
	}
	return
}
Ejemplo n.º 4
0
func (o *object) wxPtr() C.WxObjectPtr {
	return C.WxObjectPtr(o.ptr())
}
Ejemplo n.º 5
0
func wxObjectDelete(p unsafe.Pointer) {
	C.wxObject_Delete(C.WxObjectPtr(p))
}