# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304668498 0 # Node ID a4425bb24b77bf601fa02ad3b05a1fe843864847 # Parent 536ec60ee4330425bf045e64477fad6da35d1fca Fixed dw_window_destroy() on container and trees... there are multiple parts to scrollviews aparently on Mac. Also moved the removeFromSuperview further down for safety. diff -r 536ec60ee433 -r a4425bb24b77 mac/dw.m --- a/mac/dw.m Fri May 06 07:50:02 2011 +0000 +++ b/mac/dw.m Fri May 06 07:54:58 2011 +0000 @@ -7258,9 +7258,9 @@ /* Some controls are embedded in scrollviews... * so get the parent of the scrollview in that case. */ - if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSScrollView class]]) - { - object = parent; + if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSClipView class]]) + { + object = [parent superview]; parent = (DWBox *)[object superview]; } @@ -7270,11 +7270,9 @@ int z, index = -1; Item *tmpitem, *thisitem = thisbox->items; - [object removeFromSuperview]; - for(z=0;zcount;z++) { - if(thisitem[z].hwnd == handle) + if(thisitem[z].hwnd == object) index = z; } @@ -7284,6 +7282,8 @@ return 0; } + [object removeFromSuperview]; + tmpitem = malloc(sizeof(Item)*(thisbox->count-1)); /* Copy all but the current entry to the new list */