Make the button redraw after setting the image.

Don't do anything when the same contents view gets set on the window
again.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27308 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-12-16 19:28:25 +00:00
parent 21cf915c13
commit 734a6c759d
3 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,10 @@
2008-12-16 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSButtonCell.m (-setImage:): Call super implementation to
make sure the button gets redrawn.
* Source/NSWindow.m (-setContentView:): Don't do anything when
setting the same view again.
2008-12-16 13:58-EST Gregory John Casamento <greg_casamento@yahoo.com> 2008-12-16 13:58-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSNibLoading.m: Make the log ino debug in awakeFromNib * Source/GSNibLoading.m: Make the log ino debug in awakeFromNib

View file

@ -433,18 +433,12 @@ typedef struct _GSButtonCellFlags
- (void) setImage: (NSImage *)anImage - (void) setImage: (NSImage *)anImage
{ {
if (anImage)
{
NSAssert ([anImage isKindOfClass: [NSImage class]],
NSInvalidArgumentException);
}
if (_cell.image_position == NSNoImage) if (_cell.image_position == NSNoImage)
{ {
[self setImagePosition: NSImageOnly]; [self setImagePosition: NSImageOnly];
} }
ASSIGN (_cell_image, anImage); [super setImage: anImage];
} }
/**<p>Sets the NSButtonCell's alternate image to <var>anImage</var>.</p> /**<p>Sets the NSButtonCell's alternate image to <var>anImage</var>.</p>

View file

@ -1115,6 +1115,9 @@ many times.
previous content view. */ previous content view. */
- (void) setContentView: (NSView*)aView - (void) setContentView: (NSView*)aView
{ {
if (aView == _contentView)
return;
if (aView == nil) if (aView == nil)
{ {
aView = AUTORELEASE([[NSView alloc] aView = AUTORELEASE([[NSView alloc]