bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix, NSButtonCell / GMAppKit


From: Georg Fleischmann
Subject: Fix, NSButtonCell / GMAppKit
Date: Sat, 5 Feb 2005 14:36:57 GMT

Hi,

here is a little fix (or workaround) for a newly introduced problem in 
NSButtonCell.
NSButtonCell now switches the cell type in -setImagePosition, and by doing  
this sets the title of the button to nil. Setting the title to nil is correct  
for NSCell but is it also correct for NSButtonCell?

A solution could be to set the cell type in [NSButtonCell -setImagePosition:]  
directly (without calling [NSCell setType:]) and letting the _content survive.  
I'm not sure how this would interfere with other stuff, though.

The following patch simply changes the order in the gmodel loading to live  
with or without setting the title to nil.

Georg



2005-02-05  Georg Fleischmann
        * gui/Model/GMAppKit.m [NSButtonCell -initWithModelArchiver:]
          set button title after setting image position to safe the title



*** gui/Model/GMAppKit.m.old    2005-02-05 14:58:07.000000000 +0100
--- gui/Model/GMAppKit.m        2005-02-05 14:56:18.000000000 +0100
***************
*** 368,377 ****
      interval = [unarchiver decodeFloatWithName:@"interval"];
      [self setPeriodicDelay:delay interval:interval];

-     obj = [unarchiver decodeStringWithName:@"title"];
-     if (obj) [self setTitle:obj];
-     obj = [unarchiver decodeStringWithName:@"alternateTitle"];
-     if (obj) [self setAlternateTitle:obj];
      obj = [unarchiver decodeObjectWithName:@"alternateImage"];
      [self setAlternateImage:obj];
      [self setImagePosition:[unarchiver decodeIntWithName:@"imagePosition"]];
--- 368,373 ----
***************
*** 381,386 ****
--- 377,386 ----
      [self setKeyEquivalentModifierMask:[unarchiver  
decodeIntWithName:@"keyEquivalentModifierMask"]];
      [self setHighlightsBy:[unarchiver decodeIntWithName:@"highlightsBy"]];
      [self setShowsStateBy:[unarchiver decodeIntWithName:@"showsStateBy"]];
+     obj = [unarchiver decodeStringWithName:@"title"];
+     if (obj) [self setTitle:obj];
+     obj = [unarchiver decodeStringWithName:@"alternateTitle"];
+     if (obj) [self setAlternateTitle:obj];
      // }

      return self;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]