bugGNUstep - Bugs: bug #35101, Should NSTextField manage colors...

Group
 
 

bug #35101: Should NSTextField manage colors for field editor while editing?

Submitter:  Banlu Kemiyatorn <id>
Submitted:  Sun 18 Dec 2011 02:25:24 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Change Request Status:  Wont Fix
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Declined
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 03 Jan 2012 09:41:44 AM UTC, comment #3: 

On the mailing list it was concluded that this change should rather go into a subclass of NSTextField and not in the class itself.
As Bluna/Banlu has sadly left the GNustep development group, this change isn't very likely to happen.

Fred Kiefer <FredKiefer>
Group Member
Sun 18 Dec 2011 06:58:33 PM UTC, comment #2: 

Then it's better not to set colors in -setUpFieldEditorAttributes: because Apple didn't document about that.

Banlu Kemiyatorn <id>
Sun 18 Dec 2011 06:35:24 PM UTC, comment #1: 

The question is rather, does Apple do this? The behaviour you propose makes sense, but if Apple does it differently this will cause problems for people relying on the GNUstep behaviour when porting over.
From Ivan Vucica's reply I take it that, Apple hasn't implemented this behaviour, otherwise, why would he have tried to add it. This would rule out, adding it to GNUstep.

Fred Kiefer <FredKiefer>
Group Member
Sun 18 Dec 2011 02:25:24 PM UTC, original submission:  

if not, why bother setting colors in [NSCell -setUpFieldEditorAttributes:]

Index: NSTextField.m
===================================================================
--- NSTextField.m (revision 34315)
+++ NSTextField.m (working copy)
@@ -278,6 +278,9 @@
 - (void) setBackgroundColor: (NSColor *)aColor
 {
   [_cell setBackgroundColor: aColor];
+
+  NSText *t = [_window fieldEditor: NO forObject: self];
+  if (t != nil) [t setBackgroundColor: aColor];
 }
 
 /** <p>Returns the color used to draw the background.</p>
@@ -335,6 +338,9 @@
 - (void) setDrawsBackground: (BOOL)flag
 {
   [_cell setDrawsBackground: flag];
+
+  NSText *t = [_window fieldEditor: NO forObject: self];
+  if (t != nil) [t setDrawsBackground: flag];
 }
 
 /** <p>Sets the  color with which the text will be draw to aColor.</p>
@@ -343,6 +349,9 @@
 - (void) setTextColor: (NSColor *)aColor
 {
   [_cell setTextColor: aColor];
+
+  NSText *t = [_window fieldEditor: NO forObject: self];
+  if (t != nil) [t setTextColor: aColor];
 }
 
 /** <p>Returns the colour used to draw the text.</p>



Banlu Kemiyatorn <id>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by id (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-03 FredKiefer StatusNone Wont Fix
        Assigned toNone FredKiefer
        Open/ClosedOpen Declined

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code