Mercurial > dwindows
comparison mac/dw.m @ 982:a4425bb24b77
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.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 06 May 2011 07:54:58 +0000 |
parents | 536ec60ee433 |
children | 6abf763838c6 |
comparison
equal
deleted
inserted
replaced
981:536ec60ee433 | 982:a4425bb24b77 |
---|---|
7256 DWBox *parent = (DWBox *)[object superview]; | 7256 DWBox *parent = (DWBox *)[object superview]; |
7257 | 7257 |
7258 /* Some controls are embedded in scrollviews... | 7258 /* Some controls are embedded in scrollviews... |
7259 * so get the parent of the scrollview in that case. | 7259 * so get the parent of the scrollview in that case. |
7260 */ | 7260 */ |
7261 if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSScrollView class]]) | 7261 if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSClipView class]]) |
7262 { | 7262 { |
7263 object = parent; | 7263 object = [parent superview]; |
7264 parent = (DWBox *)[object superview]; | 7264 parent = (DWBox *)[object superview]; |
7265 } | 7265 } |
7266 | 7266 |
7267 if([parent isKindOfClass:[DWBox class]]) | 7267 if([parent isKindOfClass:[DWBox class]]) |
7268 { | 7268 { |
7269 Box *thisbox = [parent box]; | 7269 Box *thisbox = [parent box]; |
7270 int z, index = -1; | 7270 int z, index = -1; |
7271 Item *tmpitem, *thisitem = thisbox->items; | 7271 Item *tmpitem, *thisitem = thisbox->items; |
7272 | 7272 |
7273 [object removeFromSuperview]; | |
7274 | |
7275 for(z=0;z<thisbox->count;z++) | 7273 for(z=0;z<thisbox->count;z++) |
7276 { | 7274 { |
7277 if(thisitem[z].hwnd == handle) | 7275 if(thisitem[z].hwnd == object) |
7278 index = z; | 7276 index = z; |
7279 } | 7277 } |
7280 | 7278 |
7281 if(index == -1) | 7279 if(index == -1) |
7282 { | 7280 { |
7283 DW_MUTEX_UNLOCK; | 7281 DW_MUTEX_UNLOCK; |
7284 return 0; | 7282 return 0; |
7285 } | 7283 } |
7286 | 7284 |
7285 [object removeFromSuperview]; | |
7286 | |
7287 tmpitem = malloc(sizeof(Item)*(thisbox->count-1)); | 7287 tmpitem = malloc(sizeof(Item)*(thisbox->count-1)); |
7288 | 7288 |
7289 /* Copy all but the current entry to the new list */ | 7289 /* Copy all but the current entry to the new list */ |
7290 for(z=0;z<index;z++) | 7290 for(z=0;z<index;z++) |
7291 { | 7291 { |