1.169 class text_margin

A text_margin object may be attached to an editor object using the editor->margin_width method. The margin displays image objects for fragment objects defined on the text_buffer object associated with the editor and thus provides a way for annotating textual information.

Class text_margin is not generally usable; it's functionality is closely related to class editor. The user should not explicitly create instances of this class.

See also
- class style
- style-icon
- editor->margin_width
- editor-margin
- class fragment

1.169.1 Instance variables

text_margin <- editor: editor
Editor I'm part of. Should be the same as graphical<->device.

1.169.2 Send methods

text_margin ->initialise: editor=editor, width=int, height=int
Create from editor and dimensions. The user should create and attach a text_margin object using editor->margin_width.

1.169.3 Get methods

text_margin <-fragment: event -> fragment
Find a fragment (-icon) from an event object. This method may be used to attach event-handling to the icons displayed on the margin. For example, the following recogniser will select a fragment by clicking on the icon:
send(Editor?margin, recogniser,
         click_gesture(left, '', single,
                                   message(Editor, selected_fragment,
                                                   ?(@event?receiver, fragment,
                                                         @event)))).