Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

NSAttributedStringMBS.attributedStringWithAttachment(attachment as NSTextAttachmentMBS) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 15.0 Yes No No Yes, macOS only No
Function: Creates an attributed string with an attachment.
Example:
dim content as MemoryBlock = "Hello World"
dim f as NSFileWrapperMBS = NSFileWrapperMBS.initRegularFileWithContents(content)
f.filename = "HelloWorld.txt"

dim a as new NSTextAttachmentMBS(f)
dim s as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithAttachment(a)
Notes: This is a convenience method for creating an attributed string containing an attachment using NSAttachmentCharacter as the base character.

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithAttributedString(text as NSAttributedStringMBS) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of the given attributed string.

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithDocFormat(data as memoryblock) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given DOC file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithDocFormat(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of given DOC file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithHTML(data as memoryblock) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given HTML file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithHTML(data as memoryblock, BaseURL as string) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes the object with html code from a given url.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithHTML(data as memoryblock, BaseURL as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes the object with html code from a given url.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithHTML(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of given HTML file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithHTMLOld(data as string) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given HTML file data.
Notes: With plugin version 9.4 the attributedStringWithHTML method uses the system function to parse html. The old plugin function is available with the name attributedStringWithHTMLOld.

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithPath(file as folderitem) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given file.
Example:
// load rtfd file into textarea
dim file as FolderItem = SpecialFolder.Desktop.Child("test.rtfd")
dim n as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithPath(file)
dim t as NSTextViewMBS = TextArea1.NSTextViewMBS
t.textStorage.setAttributedString(n)
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithPath(file as folderitem, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given file.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithPath(path as string) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given path string.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithPath(path as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given path string.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithRTF(data as memoryblock) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given RTF file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithRTF(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of given RTF file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithRTFD(data as memoryblock) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given RTFD file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithRTFD(data as memoryblock, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of given RTFD file data.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithString(text as string) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of given plain text.
Example:
// create Hello World in red
dim a as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithString("Hello World")
dim m as NSMutableAttributedStringMBS = a.mutableCopy

m.addAttribute(a.NSForegroundColorAttributeName, NSColorMBS.redColor, new NSRangeMBS(0, m.length))

// put it in a textarea
TextArea1.NSTextViewMBS.textStorage.setAttributedString m
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithString(text as string, withAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of given plain text.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithURL(file as folderitem) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given file.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithURL(file as folderitem, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given file.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithURL(url as string) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.2 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given url.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.attributedStringWithURL(url as string, byref DocumentAttributes as dictionary) as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.0 Yes No No Yes, macOS only No
Function: Initializes string with content of file at the given url.
Notes: documentAttributes: Optional dictionary to receive the attributes.

See also:

Feedback, Comments & Corrections

NSAttributedStringMBS.NSAttachmentAttributeName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the attribute names for NSAttributedString.
Notes:
NSTextAttachment
Default nil, no attachment

Feedback, Comments & Corrections

NSAttributedStringMBS.NSAuthorDocumentAttribute as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the names for document wide attributes in a NSAttributedString.
Example:
// get some attributed text:
dim t as new NSAttributedStringMBS
call t.initWithString("Hello World")

// set document attributes
dim dic as new Dictionary
dic.Value(t.NSAuthorDocumentAttribute) = "Test User"

// get rtf
dim rtf as string = t.RTFFromRange(dic)

// write to file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim b as BinaryStream = BinaryStream.Create(f, true)
b.Write rtf
Notes:
string containing author name.
Available in Mac OS X v10.4 and later.

Feedback, Comments & Corrections

NSAttributedStringMBS.NSBackgroundColorAttributeName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the attribute names for NSAttributedString.
Notes:
NSColor
Default nil, no background

Feedback, Comments & Corrections

NSAttributedStringMBS.NSBackgroundColorDocumentAttribute as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the names for document wide attributes in a NSAttributedString.
Notes:
NSColor, representing the document-wide page background color.
Mac OS X v10.3 and earlier string constant is "BackgroundColor".
For applications linked on versions prior to Mac OS X v10.5, HTML import sets the NSBackgroundColorDocumentAttribute to NSColorMBS.whiteColor in cases in which the HTML does not specify a background color. For applications linked on Mac OS X v10.5 and later, no NSBackgroundColorDocumentAttribute is set in these cases.
Available in Mac OS X v10.4 and later.

Feedback, Comments & Corrections

NSAttributedStringMBS.NSBaselineOffsetAttributeName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the attribute names for NSAttributedString.
Notes:
Number containing floating point value, as points offset from baseline
Default 0.0

Feedback, Comments & Corrections

NSAttributedStringMBS.NSBaseURLDocumentOption as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 11.3 Yes No No Yes, macOS only No
Function: One of the attribute names for NSAttributedString.
Notes:
For HTML documents; NSURL containing base URL. Previous string constant was @"BaseURL"
Available in Mac OS X v10.4 and later.

Feedback, Comments & Corrections

Next items

The items on this page are in the following plugins: MBS MacBase Plugin.




Links
MBS Xojo PDF Plugins