comparison ios/dw.m @ 2649:76d876c441c9

iOS: Minor code cleanup in the bitmap button image handler.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 31 Aug 2021 09:35:36 +0000
parents 2362cb4b7ef9
children a39e2ea6fa14
comparison
equal deleted inserted replaced
2648:2362cb4b7ef9 2649:76d876c441c9
4316 UIImage *image = [[UIImage alloc] initWithContentsOfFile:filepath]; 4316 UIImage *image = [[UIImage alloc] initWithContentsOfFile:filepath];
4317 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom); 4317 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom);
4318 if(image) 4318 if(image)
4319 { 4319 {
4320 [button setImage:image forState:UIControlStateNormal]; 4320 [button setImage:image forState:UIControlStateNormal];
4321 } 4321 [image release];
4322 [image release]; 4322 }
4323 DW_FUNCTION_RETURN_THIS(button); 4323 DW_FUNCTION_RETURN_THIS(button);
4324 } 4324 }
4325 4325
4326 /* 4326 /*
4327 * Create a new bitmap button window (widget) to be packed from a file. 4327 * Create a new bitmap button window (widget) to be packed from a file.
4349 } 4349 }
4350 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom); 4350 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom);
4351 if(image) 4351 if(image)
4352 { 4352 {
4353 [button setImage:image forState:UIControlStateNormal]; 4353 [button setImage:image forState:UIControlStateNormal];
4354 } 4354 [image release];
4355 [image release]; 4355 }
4356 DW_FUNCTION_RETURN_THIS(button); 4356 DW_FUNCTION_RETURN_THIS(button);
4357 } 4357 }
4358 4358
4359 /* 4359 /*
4360 * Create a new bitmap button window (widget) to be packed from data. 4360 * Create a new bitmap button window (widget) to be packed from data.
4374 UIImage *image = [[UIImage alloc] initWithData:thisdata]; 4374 UIImage *image = [[UIImage alloc] initWithData:thisdata];
4375 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom); 4375 DWButton *button = _dw_internal_button_new("", cid, UIButtonTypeCustom);
4376 if(image) 4376 if(image)
4377 { 4377 {
4378 [button setImage:image forState:UIControlStateNormal]; 4378 [button setImage:image forState:UIControlStateNormal];
4379 } 4379 [image release];
4380 [image release]; 4380 }
4381 DW_FUNCTION_RETURN_THIS(button); 4381 DW_FUNCTION_RETURN_THIS(button);
4382 } 4382 }
4383 4383
4384 /* 4384 /*
4385 * Create a new spinbutton window (widget) to be packed. 4385 * Create a new spinbutton window (widget) to be packed.