Module textadept.pm.browser
A model browser for the Textadept project manager. It can be loaded by adding to the browsers table in core/ext/pm.lua or by 'require'ing it elsewhere. [Dummy file]
Functions
| get_contents_for (full_path, expanding) | This function is called for contents to show in the browser. |
| get_context_menu (selected_item) | Requests a context menu for the selected item in the browser. |
| matches (entry_text) | Determines whether or not to use this browser for the text in the project manager entry. |
| perform_action (selected_item) | This function is called when a user selects an item in the browser. |
| perform_menu_action (menu_item, selected_item) | This function is called when a user selects a context menu item. |
Functions
- get_contents_for (full_path, expanding)
-
This function is called for contents to show in the browser.
Parameters
- full_path: An ordered list of parent IDs leading down to the selected child (if expanding); the entry text is at the first index.
- expanding: Boolean indicating whether or not a parent is being expanded.
Return value:
table of contents to display. Each entry in the table is a key-value pair. The key must be a string ID and the value a table. Three key-value pairs are looked for in the table: parent, pixbuf, and display_text. parent is an optional boolean indicating whether or not the item should be identified as a parent (parents can be expanded so they have the arrow next to them). pixbuf is an optional string specifying a GTK stock icon to be associated with the item. text is a required string that is shown in the project manager; it can have Pango markup. All other items in the table are ignored. - get_context_menu (selected_item)
-
Requests a context menu for the selected item in the browser.
Parameters
- selected_item: An ordered list of parent IDs leading down to the selected child; the entry text is at the first index.
Return value:
table used to construct a GTK menu. See also: textadept.gtkmenu - matches (entry_text)
-
Determines whether or not to use this browser for the text in the project manager entry. All loaded browsers are called in sequence to match to the given entry text. When a match is found, that browser is used.
Parameters
- entry_text: The text in the entry.
Return value:
boolean indicating whether or not to use this browser. - perform_action (selected_item)
-
This function is called when a user selects an item in the browser.
Parameters
- selected_item: An ordered list of parent IDs leading down to the selected child; the entry text is at the first index.
- perform_menu_action (menu_item, selected_item)
-
This function is called when a user selects a context menu item.
Parameters
- menu_item: The text of the menu item selected.
- selected_item: An ordered list of parent IDs leading down to the selected child; the entry text is at the first index.