Module textadept.pm.browser
A model browser for the Textadept project manager.
Functions
get_contents_for (full_path, expanding) | Requests treeview contents from browser that matches pm_entry's text. |
get_context_menu (selected_item) | Creates a context menu based on the selected treeview item. |
matches (entry_text) | Determines whether or not to use this browser for the text in the project manager entry. |
perform_action (selected_item) | Performs an action based on the selected treeview item. |
perform_menu_action (menu_id, selected_item) | Performs an action based on the selected menu item. |
toggle_visible () | Toggles the width of the project manager. |
Functions
- get_contents_for (full_path, expanding)
-
Requests treeview contents from browser that matches pm_entry's text. This function is called internally and shouldn't be called by a script.
Parameters
- full_path: A numerically indexed table of treeview item parents. The first index contains the text of pm_entry. Subsequent indexes contain the ID's of parents of the child requested for expanding (if any).
- expanding: Optional flag indicating if the contents of a parent are being requested. Defaults to false.
Return value:
table of tables to for display in the treeview (single level). Each key in the return table is the treeview item's ID. The table value has the following recognized fields: parent - boolean value indicating if this entry can contain children. If true, an expanding arrow is displayed next to the entry. pixbuf - a string representing a GTK stock-id whose icon is displayed next to an entry. text - the entry's Pango marked-up display text. Note that only a SINGLE level of data needs to be returned. When parents are expanded, this function is called again to get that level of data. - get_context_menu (selected_item)
-
Creates a context menu based on the selected treeview item. This function is called internally and shouldn't be called by a script.
Parameters
- selected_item: Identical to 'full_path' in pm.get_contents_for.
Return value:
table of menu items. The return table consists of an ordered list of strings to be used to construct a context menu. The strings are handled as follows: 'gtk-*' - a stock menu item is created based on the GTK stock-id. 'separator' - a menu separator item is created. Otherwise a regular menu item with a mnemonic is created. - 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)
-
Performs an action based on the selected treeview item. This function is called internally and shouldn't be called by a script.
Parameters
- selected_item: Identical to 'full_path' in get_contents_for.
See also:
- perform_menu_action (menu_id, selected_item)
-
Performs an action based on the selected menu item. This function is called internally and shouldn't be called by a script.
Parameters
- menu_id: The numeric ID of the menu item.
- selected_item: Identical to 'full_path' in get_contents_for.
See also:
- toggle_visible ()
- Toggles the width of the project manager. If the pm is visible, it's width is saved and then set to 0, effectively hiding it. If it is hidden, the width is restored.