Contents

gui

The core gui table.


Fields


clipboard_text (string, Read-only)

The text on the clipboard.


context_menu

A GTK menu defining the editor’s context menu.


docstatusbar_text (string, Write-only)

The text displayed by the doc statusbar.


statusbar_text (string)

The text displayed by the statusbar.


title (string)

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. If the message buffer is already open and a view is currently showing it, the message is printed to that view. Otherwise the view is split, goes to the open message buffer, and prints to it.

Parameters:

Usage:


dialog (kind, …)

Displays a gcocoadialog of a specified type with the given string arguments. Each argument is like a string in Lua’s arg table. Tables of strings are allowed as arguments and are expanded in place. This is useful for filteredlist dialogs with many items.

Parameters:

Return:


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

Shortcut function for gui.dialog('filtered_list', ...) with ‘Ok’ and ‘Cancel’ buttons.

Parameters:

Usage:

Return:


get_split_table ()

Gets the current split view structure.

Return:


goto_file (filename, split, preferred_view, sloppy)

Goes to the buffer with the given filename. If the desired buffer is open in a view, goes to that view. Otherwise, opens the buffer in either the preferred_view if given, the first view that is not the current one, a split view if split is true, or the current view.

Parameters:


goto_view (n, relative)

Goes to the specified view. Generates VIEW_BEFORE_SWITCH and VIEW_AFTER_SWITCH events.

Parameters:


gtkmenu (menu_table)

Creates a GTK menu, returning the userdata.

Parameters:

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 filtered list.


set_theme (name)

Sets the editor theme from the given name. Themes in _USERHOME/themes/ are checked first, followed by _HOME/themes/. If the name contains slashes (‘/’ on Linux and Mac OSX and ‘\’ on Win32), it is assumed to be an absolute path so _USERHOME and _HOME are not checked. Throws an error if the theme is not found. Any errors in the theme are printed to io.stderr.

Parameters:


switch_buffer ()

Displays a dialog with a list of buffers to switch to and switches to the selected one, if any.


Tables


menubar

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


size

The size of the Textadept window ({ width, height }).