All Manuals > CAPI Reference Manual > 1 CAPI Reference Entries




A text pane with extended formatting.







A plist.


A plist.


A function called when a change is made.


A function determining whether the user may edit a protected part of the text, on Microsoft Windows.


A file to display.


A string or nil .


An integer.




The class rich-text-pane provides a text editor which supports character and paragraph formatting of its text.

character-format is the default character format. It is a plist which is interpreted in the same way as the attributes-plist argument of set-rich-text-pane-character-format. The default value of character-format is nil .

paragraph-format is the default paragraph format. It is a plist which is interpreted in the same way as the attributes-plist argument of set-rich-text-pane-paragraph-format. The default value of paragraph-format is nil .

change-callback , if non-nil, is a function of two arguments: the pane itself, and a keyword denoting the type of change. This second argument is either :text or :selection . The default value of change-callback is nil .

protected-callback , if supplied, is called when the user tries to modify protected text (by setting the protected attribute, see set-rich-text-pane-character-format). It must be a function of four arguments: the pane itself, bounding indexes of the protected text, and a boolean which is true when the change would affect the selection. If the change would affect just a single character, this last argument is nil . If protected-callback returns nil , then the change is not performed. If protected-callback is not supplied, then the user cannot modify protected text. protected-callback is supported only on Microsoft Windows.

filename , if non-nil, should be a string or pathname naming a file to display in the pane. filename takes precedence over text if both are non-nil.

text , if non-nil, should be a string which is displayed in the pane if filename is nil .

text-limit , if non-nil, should be an integer which is an upper bound for the length of text displayed in the pane.

  1. rich-text-pane is supported only on Microsoft Windows, and Cocoa in Mac OS X 10.3 and later. Some of its features are supported only on Microsoft Windows, as mentioned above.
  2. change-callback and protected-callback are not yet implemented on Cocoa.
  3. The functions that are specific to rich-text-pane cannot be called before the pane is created. If you need to perform operations on the pane before it appears, and which cannot be performed using the initargs, the best approach is to define an :after method on interface-display on the class of the interface containing the rich-text-pane , and perform the operations inside this method.
See also


CAPI Reference Manual - 15 Dec 2011