bugGNUstep - Bugs: bug #23954, setFont not implemented in...

Group
 
 

bug #23954: setFont not implemented in nSTextStorage

Submitter:  Riccardo Mottola <rmottola>
Submitted:  Mon 28 Jul 2008 09:57:53 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Change Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 19 Aug 2008 07:01:32 AM UTC, comment #4: 

Sorry, my fault. I change a sentence I wrote around, but didn't adjust the words. What I wanted to say was, NSTextView (and the abstract class NSText) both support setFont: in GNustep. For the class NSTextStorage this method is only provided as a scripting extension and currently GNUstep doesn't provide most of these extensions.

There wont be a problem to include this method if you really need it an provide an implementation. OK, this is really easy, here is one (code stolen from NSTextView), but why would we want it?

- (void) setFont: (NSFont *)font
{
  if (!font)
    return;

  [self addAttribute: NSFontAttributeName
    value: font
    range: NSMakeRange(0, [self length])];
}

As soon as you provide a good reason for it, I will add this method to a scripting category on NSTextStorage.

Fred Kiefer <FredKiefer>
Group Member
Sun 17 Aug 2008 07:57:50 PM UTC, comment #3: 

I changed the code in FTP now, but the code I had was working fine under mac 10.3.

NSTextView inherits from NSText on the mac, which has setFont.

Riccardo Mottola <rmottola>
Group Member
Tue 12 Aug 2008 08:51:02 PM UTC, comment #2: 

This method is one of the scripting methods of that class and currently GNustep does not plan to implement those methods.
You may go ahead to implement it yourself if you want to, though.

Why is FTP using this method at all and when did you start to do so? There should be better ways to achive the same result.

You second posting looks like you are mistaking NSTextView for NSTextStorage, the later has a setFont: method.

Fred Kiefer <FredKiefer>
Group Member
Tue 29 Jul 2008 10:56:52 PM UTC, comment #1: 

this is a class not existent on OpenStep, so it is more a Feature request.
Interestingly though NSTextView is a subclass of NSText, which had setFont even in OpenStep times and has it in GNUstep. So this exception is weird.

Riccardo Mottola <rmottola>
Group Member
Mon 28 Jul 2008 09:57:53 PM UTC, original submission:  

/usr/GNUstep/Local/Applications/FTP.app/FTP: Uncaught exception NSInvalidArgumentException, reason: GSTextStorage(instance) does not recognize setFont:


(using Cairo on Linux, latest SVN)

Riccardo Mottola <rmottola>
Group Member

 

(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 rmottola (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-12 FredKiefer Item GroupNone Change Request

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code