Browse Source

oui: added uiSetSelfHandle()

pull/1/head
Leonard Ritter 10 years ago
parent
commit
001e763f73
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      oui.h

+ 10
- 0
oui.h View File

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


Loading…
Cancel
Save