comparison mac/dw.m @ 983:6abf763838c6

Allow checboxes and other "buttons" to have a blank title instead of the default "Button" if an empty string is passed as the title.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 00:09:24 +0000
parents a4425bb24b77
children 87dc0f5f96d0
comparison
equal deleted inserted replaced
982:a4425bb24b77 983:6abf763838c6
3318 } 3318 }
3319 3319
3320 HWND _button_new(char *text, ULONG cid) 3320 HWND _button_new(char *text, ULONG cid)
3321 { 3321 {
3322 DWButton *button = [[DWButton alloc] init]; 3322 DWButton *button = [[DWButton alloc] init];
3323 if(text && *text) 3323 if(text)
3324 { 3324 {
3325 [button setTitle:[ NSString stringWithUTF8String:text ]]; 3325 [button setTitle:[ NSString stringWithUTF8String:text ]];
3326 } 3326 }
3327 [button setTarget:button]; 3327 [button setTarget:button];
3328 [button setAction:@selector(buttonClicked:)]; 3328 [button setAction:@selector(buttonClicked:)];
7252 } 7252 }
7253 /* Handle destroying a control or box */ 7253 /* Handle destroying a control or box */
7254 else if([object isKindOfClass:[DWBox class]] || [object isKindOfClass:[NSControl class]]) 7254 else if([object isKindOfClass:[DWBox class]] || [object isKindOfClass:[NSControl class]])
7255 { 7255 {
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:[NSClipView class]]) 7261 if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSClipView class]])
7262 { 7262 {
7263 object = [parent superview]; 7263 object = [parent superview];