Athena text widget actions

Contents

Cursor Movement Actions

forward-character()
backward-character()
These actions move the insert point forward or backward one character in the buffer. If the insert point is at the end or beginning of a line this action will move the insert point to the next (or previous) line.
forward-word()
backward-word()
These actions move the insert point to the next or previous word boundary. A word boundary is defined as a Space, Tab or Carriage Return.
forward-paragraph()
backward-paragraph()
These actions move the insert point to the next or previous paragraph boundary. A paragraph boundary is defined as two Carriage Returns in a row with only Spaces or Tabs between them.
beginning-of-line()
end-of-line()
These actions move to the beginning or end of the current line. If the insert point is already at the end or beginning of the line then no action is taken.
next-line()
previous-line()
These actions move the insert point up or down one line. If the insert point is currently N characters from the beginning of the line then it will be N characters from the beginning of the next or previous line. If N is past the end of the line, the insert point is placed at the end of the line.
next-page()
previous-page()
These actions move the insert point up or down one page in the file. One page is defined as the current height of the text widget. The insert point is always placed at the first character of the top line by this action.
beginning-of-file()
end-of-file()
These actions place the insert point at the beginning or end of the current text buffer. The text widget is then scrolled the minimum amount necessary to make the new insert point location visible.
scroll-one-line-up()
scroll-one-line-down()
These actions scroll the current text field up or down by one line. They do not move the insert point. Other than the scrollbars this is the only way that the insert point may be moved off of the visible text area. The widget will be scrolled so that the insert point is back on the screen as soon as some other action is executed.

Delete Actions

delete-next-character()
delete-previous-character()
These actions remove the character immediately before or after the insert point. If a Carriage Return is removed then the next line is appended to the end of the current line.
delete-next-word()
delete-previous-word()
These actions remove all characters between the insert point location and the next word boundary. A word boundary is defined as a Space, Tab or Carriage Return.
delete-selection()
This action removes all characters in the current selection. The selection can be set with the selection actions.

Selection Actions

select-word()
This action selects the word in which the insert point is currently located. If the insert point is between words then it will select the previous word.
select-all()
This action selects the entire text buffer.
select-start()
This action sets the insert point to the current pointer location. It will then begin a selection at this location. If many of these selection actions occur quickly in succession then the selection count mechanism will be invoked (see the section titled Text Selections for Application Programmers for details).
select-adjust()
This action allows a selection started with the action to be modified, as described above.
select-end (name [,name,...])
This action ends a text selection that began with the select-start action, and asserts ownership of the selection or selections specified. A name can be a selection (e.g. PRIMARY) or a cut buffer (e.g CUT_BUFFER0). Note that case is important. If no names are specified, PRIMARY is asserted.
extend-start()
This action finds the nearest end of the current selection, and moves it to the current pointer location.
extend-adjust()
This action allows a selection started with an extend-start action to be modified.
extend-end(name [,name,...])
This action ends a text selection that began with the extend-start action, and asserts ownership of the selection or selections specified. A name can be a selection (e.g. PRIMARY) or a cut buffer (e.g CUT_BUFFER0). Note that case is important. If no names are given, PRIMARY is asserted.
insert-selection(name [,name,...])
This action retrieves the value of the first (left-most) named selection that exists or the cut buffer that is not empty and inserts it into the Text widget at the current insert point location. A name can be a selection (e.g. PRIMARY) or a cut buffer (e.g CUT_BUFFER0). Note that case is important.

New Line Actions

newline-and-indent()
This action inserts a newline into the text and adds spaces to that line to indent it to match the previous line.
newline-and-backup()
This action inserts a newline into the text after the insert point.
newline()
This action inserts a newline into the text before the insert point.

Kill Actions

kill-word()
backward-kill-word()
These actions act exactly like the delete-next-word and delete-previous-word actions, but they stuff the word that was killed into the kill buffer (CUT_BUFFER_1).
kill-selection()
This action deletes the current selection and stuffs the deleted text into the kill buffer (CUT_BUFFER_1).
kill-to-end-of-line()
This action deletes the entire line to the right of the insert point position, and stuffs the deleted text into the kill buffer (CUT_BUFFER_1).
kill-paragraph()
This action deletes the current paragraph, if between paragraphs it deletes the paragraph above the insert point, and stuffs the deleted text into the kill buffer (CUT_BUFFER_1).
kill-to-end-of-paragraph()
This action deletes everything between the current insert point location and the next paragraph boundary, and stuffs the deleted text into the kill buffer (CUT_BUFFER_1).

Miscellaneous actions

redraw-display()
This action recomputes the location of all the text lines on the display, scrolls the text to vertically center the line containing the insert point on the screen, clears the entire screen, and redisplays it.
insert-file([filename])
This action activates the insert file popup. The filename option specifies the default filename to put in the filename buffer of the popup. If no filename is specified the buffer is empty at startup.
insert-char()
This action may only be attached to a key event. It calls XLookupString to translate the event into a (rebindable) Latin-1 character (sequence) and inserts that sequence into the text at the insert point position.
insert-string(string[,string,...])
This action inserts each string into the text at the insert point location. Any string beginning with the characters "0x" and containing only valid hexadecimal digits in the remainder is interpreted as a hexadecimal constant and the corresponding single character is inserted instead.
display-caret(state,when)
This action allows the insert point to be turned on and off. The state argument specifies the desired state of the insert point. This value may be any of the string values accepted for Boolean resources (e.g. on, True, off, False, etc.). If no arguments are specified, the default value is True. The when argument specifies, for EnterNotify or LeaveNotify events whether or not the focus field in the event is to be examined. If the second argument is not specified, or specified as something other than always then if the action is bound to an EnterNotify or LeaveNotify event, the action will be taken only if the focus field is True. An augmented binding that might be useful is:
    *Text.Translations: #override \
        :    display-caret(on) \n\
        :    display-caret(off)
focus-in()
focus-out()
These actions do not currently do anything.
search(direction,[string])
This action activates the search popup. The direction must be specified as either forward or backward. The string is optional and is used as an initial value for the Search for: string. For further explanation of the search widget see the section on Text Searches.
multiply(value)
The multiply action allows the user to multiply the effects of many of the text actions. Thus the following action sequence multiply(10) delete-next-word() will delete 10 words. It does not matter whether these actions take place in one event or many events. Using the default translations the key sequence Control-u, Control-d will delete 4 characters. Multiply actions can be chained, thus multiply(5) multiply(5) is the same as multiply(25). If the string reset is passed to the multiply action the effects of all previous multiplies are removed and a beep is sent to the display.
form-paragraph()
This action removes all the Carriage Returns from the current paragraph and reinserts them so that each line is as long as possible, while still fitting on the current screen. Lines are broken at word boundaries if at all possible. This action currently works only on Text widgets that use ASCII text.
transpose-characters()
This action will swap the position of the character to the left of the insert point with the character to the right of the insert point. The insert point will then be advanced one character.
no-op([action])
The no-op action makes no change to the text widget, and is mainly used to override translations. This action takes one optional argument. If this argument is RingBell then a beep is sent to the display.

Default key bindings

KeystrokeAction
Ctrl-Abeginning-of-line()
Ctrl-Bbackward-character()
Ctrl-Ddelete-next-character()
Ctrl-Eend-of-line()
Ctrl-Fforward-character()
Ctrl-Gmultiply(Reset)
Ctrl-Hdelete-previous-character()
Ctrl-Jnewline-and-indent()
Ctrl-Kkill-to-end-of-line()
Ctrl-Lredraw-display()
Ctrl-Mnewline()
Ctrl-Nnext-line()
Ctrl-Onewline-and-backup()
Ctrl-Pprevious-line()
Ctrl-Rsearch(backward)
Ctrl-Ssearch(forward)
Ctrl-Ttranspose-characters()
Ctrl-Umultiply(4)
Ctrl-Vnext-page()
Ctrl-Wkill-selection()
Ctrl-Yinsert-selection(CUT_BUFFER1)
Ctrl-Zscroll-one-line-up()
Meta-Bbackward-word()
Meta-Fforward-word()
Meta-Iinsert-file()
Meta-Kkill-to-end-of-paragraph()
Meta-Qform-paragraph()
Meta-Vprevious-page()
Meta-Yinsert-selection(PRIMARY, CUT_BUFFER0)
Meta-Zscroll-one-line-down()
:Meta-ddelete-next-word()
:Meta-Dkill-word()
:Meta-hdelete-previous-word()
:Meta-Hbackward-kill-word()
:Meta-<beginning-of-file()
:Meta->end-of-file()
:Meta-]forward-paragraph()
:Meta-[backward-paragraph()
~Shift Meta-Deletedelete-previous-word()
Shift Meta-Deletebackward-kill-word()
~Shift Meta-Backspacedelete-previous-word()
Shift Meta-Backspacebackward-kill-word()
Rightforward-character()
Leftbackward-character()
Downnext-line()
Upprevious-line()
Deletedelete-previous-character()
BackSpacedelete-previous-character()
Linefeednewline-and-indent()
Returnnewline()
 insert-char()
<FocusIn>focus-in()
<FocusOut>focus-out()
<Btn1Down>select-start()
<Btn1Motion>extend-adjust()
<Btn1Up>extend-end(PRIMARY, CUT_BUFFER0)
<Btn2Down>insert-selection(PRIMARY, CUT_BUFFER0)
<Btn3Down>extend-start()
<Btn3Motion>extend-adjust()
<Btn3Up>extend-end(PRIMARY, CUT_BUFFER0)