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; }