Contents

gui

Utilities for interacting with Textadept’s user interface.


Fields


clipboard_text (string, Read-only)

The text on the clipboard.


context_menu

The editor’s context menu, a gui.menu(). This is a low-level field. You probably want to use the higher-level _M.textadept.menu.set_contextmenu().


docstatusbar_text (string, Write-only)

The text displayed by the buffer statusbar.


statusbar_text (string, Write-only)

The text displayed by the statusbar.


title (string, Write-only)

The title of the Textadept window.


Functions


_print(buffer_type, …)

Helper function for printing messages to buffers. Splits the view and opens a new buffer for printing messages to. If the message buffer is already open in a view, the message is printed to that view. Otherwise the view is split and the message buffer is opened or displayed before being printed to.

Parameters:

Usage:


dialog(kind, …)

Displays a kind gtdialog with the given string arguments to pass to the dialog and returns a formatted string of the dialog’s output. Table arguments containing strings are allowed and expanded in place. This is useful for filtered list dialogs with many items. For more information on gtdialog, see http://foicica.com/gtdialog.

Parameters:

Return:


filteredlist(title, columns, items, int_return, …)

Convenience function for gui.dialog('filteredlist', ...) with “Ok” and “Cancel” buttons that returns the text or index of the selection depending on the boolean value of int_return. title is the title of the dialog, columns is a list of column names, and items is a list of items to show.

Parameters:

Usage:

Return:

See also:


get_split_table()

Returns the current split view structure. This is primarily used in session saving.

Return:


goto_file(filename, split, preferred_view, sloppy)

Goes to the buffer whose filename is filename in an existing view, otherwise splitting the current view if split is true or going to the next or preferred_view view instead of staying in the current one. If sloppy is true, only the last part of filename is matched to a buffer’s filename.

Parameters:


goto_view(n, relative)

Goes to view number n. If relative is true, n is an index relative to the index of the current view in _G._VIEWS instead of an absolute index. Emits VIEW_BEFORE_SWITCH and VIEW_AFTER_SWITCH events.

Parameters:

See also:


menu(menu_table)

Low-level function for creating a menu from table menu_table and returning the userdata. You probably want to use the higher-level _M.textadept.menu.set_menubar() or _M.textadept.menu.set_contextmenu() functions. Emits a MENU_CLICKED event when a menu item is selected.

Parameters:

Usage:

See also:


print()

Prints messages to the Textadept message buffer. Opens a new buffer if one has not already been opened for printing messages.

Parameters:


select_theme()

Prompts the user to select an editor theme from a list of themes found in the _HOME/themes/ and _USERHOME/themes/ directories.


set_theme(name)

Sets the editor theme name to name or the default platform theme. Themes with name in the _USERHOME/themes/ directory override themes of the same name in _HOME/themes/. If name contains slashes (‘\’ on Windows, ‘/’ otherwise), it is assumed to be an absolute path to a theme instead of a theme name. An error is thrown if the theme is not found. Any errors in the theme are printed to io.stderr. Running Textadept from a terminal is the easiest way to see errors as they occur.

Parameters:


switch_buffer()

Prompts the user to select a buffer to switch to.


Tables


menubar

A table of menus defining a menubar. (Write-only)

See also:


size

A table containing the width and height values of the Textadept window.