From 001e763f7363bfcfd60c985d4c898e1bc737cf85 Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Fri, 8 Aug 2014 17:03:02 +0200 Subject: [PATCH] oui: added uiSetSelfHandle() --- oui.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/oui.h b/oui.h index a348e9a..059b0a3 100644 --- a/oui.h +++ b/oui.h @@ -400,6 +400,10 @@ void uiSetFrozen(int item, int enable); // will not be interactive. void uiSetHandle(int item, UIhandle handle); +// assigns the items own address as handle; this may cause glitches +// when the order of items changes while theitem is captured +void uiSetSelfHandle(int item); + // allocate space for application-dependent context data and return the pointer // if successful. If no data has been allocated, a new pointer is returned. // Otherwise, an assertion is thrown. @@ -1266,6 +1270,12 @@ void uiSetHandle(int item, UIhandle handle) { } } +void uiSetSelfHandle(int item) { + UIitem *pitem = uiItemPtr(item); + pitem->handle = (UIhandle)pitem; + uiHashInsertHandle((UIhandle)pitem, item); +} + UIhandle uiGetHandle(int item) { return uiItemPtr(item)->handle; }