func (h *evtHandler) QueueEvent(event Event) { p := wxPtr(h) if p == nil { return } event.unhold() C.wxEvtHandler_QueueEvent(p, C.WxObjectPtr(wxPtr(event))) }
func (h *evtHandler) QueueEvent(event Event) { p := ptr(h) if p == nil { return } globalObjectTable.unhold(event) C.wxEvtHandler_QueueEvent(p, C.WxObjectPtr(ptr(event))) }
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 }
func (o *object) wxPtr() C.WxObjectPtr { return C.WxObjectPtr(o.ptr()) }
func wxObjectDelete(p unsafe.Pointer) { C.wxObject_Delete(C.WxObjectPtr(p)) }