Skip to content
rthrd edited this page Nov 18, 2014 · 8 revisions

The BufferManager contains several handy dialog functions:

These functions display a prompt at the bottom of the screen; answers may be typed directly or choosen by tab-completion

The names of the functions are quite self-explanatory.

Common arguments are:

domain: token for internal use of BufferManager
question: string used as prompt
completions: array of possible answers, that can be completed by using the tab key
default: default value, it is written after the prompt and has to be deleted in order to substitute it!

Of use for writing interacive hooks are namely:

BufferManager::ask_with_completions domain, question, completions, default=nil
BufferManager::ask_many_with_completions domain, question, completions, default=nil
BufferManager::ask_many_emails_with_completions domain, question, completions, default=nil
BufferManager::ask_for_filename domain, question, default=nil, allow_directory=falseer::
BufferManager::ask_for_labels domain, question, default_labels, forbidden_labels=[]
BufferManager::ask_for_contacts domain, question, default_contacts=[]
BufferManager::ask_for_account domain, question
BufferManager::ask_yes_or_no question

For output to the user the HookManager provides say, so just use

say "message to the user"
Clone this wiki locally