Removed the now-obsolete old method of freeing OS X controls.
This commit is contained in:
parent
9fae528fd4
commit
6436737720
|
@ -230,15 +230,3 @@ void uiDarwinNewControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrol
|
||||||
c->ContainerEnable = singleContainerEnable;
|
c->ContainerEnable = singleContainerEnable;
|
||||||
c->ContainerDisable = singleContainerDisable;
|
c->ContainerDisable = singleContainerDisable;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview)
|
|
||||||
{
|
|
||||||
singleView *s = (singleView *) (c->Internal);
|
|
||||||
|
|
||||||
if (newSuperview == destroyedControlsView) {
|
|
||||||
[s->immediate release]; // we don't need the reference anymore
|
|
||||||
uiFree(s);
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
|
@ -11,10 +11,7 @@ This file assumes that you have imported <Cocoa/Cocoa.h> and "ui.h" beforehand.
|
||||||
// The second parameter should come from [RealControlType class].
|
// The second parameter should come from [RealControlType class].
|
||||||
// The two scrollView parameters allow placing scrollbars on the new control.
|
// The two scrollView parameters allow placing scrollbars on the new control.
|
||||||
// The two onDestroy parameters define a function and its parameter to call when the widget is destroyed.
|
// The two onDestroy parameters define a function and its parameter to call when the widget is destroyed.
|
||||||
// Your control must call uiDarwinControlFreeWhenAppropriate() on the returned uiControl in its -[viewDidMoveToSuperview] method.
|
|
||||||
// If it returns a value other than NO, then the uiControl has been freed and you should set references to it to NULL.
|
|
||||||
extern void uiDarwinNewControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrollViewHasBorder, void (*onDestroy)(void *), void *onDestroyData);
|
extern void uiDarwinNewControl(uiControl *c, Class class, BOOL inScrollView, BOOL scrollViewHasBorder, void (*onDestroy)(void *), void *onDestroyData);
|
||||||
extern BOOL uiDarwinControlFreeWhenAppropriate(uiControl *c, NSView *newSuperview);
|
|
||||||
|
|
||||||
// You can use this function from within your control implementations to return text strings that can be freed with uiTextFree().
|
// You can use this function from within your control implementations to return text strings that can be freed with uiTextFree().
|
||||||
extern char *uiDarwinNSStringToText(NSString *);
|
extern char *uiDarwinNSStringToText(NSString *);
|
||||||
|
|
Loading…
Reference in New Issue