The Message Window is a one-line interactive window at the bottom of the screen. More...
Functions | |
int | mw_get_field (const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata) |
Ask the user for a string -. | |
int | mw_change_flag (struct Mailbox *m, struct EmailArray *ea, bool bf) |
Change the flag on a Message -. | |
int | mw_enter_fname (const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags) |
Ask the user to select a file -. | |
void | mw_what_key (void) |
Display the value of a key -. | |
int | mw_multi_choice (const char *prompt, const char *letters) |
Offer the user a multiple choice question -. | |
static enum QuadOption | mw_yesorno (const char *prompt, enum QuadOption def, struct ConfigDef *cdef, GetChFlags flags) |
Ask the user a Yes/No question offering help -. | |
The Message Window is a one-line interactive window at the bottom of the screen.
It's used for asking the user questions, displaying messages and for a progress bar.
The Message Window has two modes of behaviour: passive, active.
Most of the time, the Message Window will be passively displaying messages to the user (or empty). This is characterised by the Window focus being somewhere else. In this mode, the Message Window is responsible for drawing itself.
The Message Window can be hijacked by other code to be used for user interaction, commonly for simple questions, "Are you sure? [Y/n]". In this active state the Window will have focus and it's the responsibility of the hijacker to perform the drawing.
Name | Type | Constructor |
---|---|---|
Message Window | WT_MESSAGE | msgwin_new() |
Parent
Children
The Message Window caches the formatted string.
Once constructed, it is controlled by the following events:
Event Type | Handler |
---|---|
NT_WINDOW | msgwin_window_observer() |
MuttWindow::recalc() | msgwin_recalc() |
MuttWindow::repaint() | msgwin_repaint() |
int mw_get_field | ( | const char * | prompt, |
struct Buffer * | buf, | ||
CompletionFlags | complete, | ||
enum HistoryClass | hclass, | ||
const struct CompleteOps * | comp_api, | ||
void * | cdata | ||
) |
Ask the user for a string -.
[in] | prompt | Prompt |
[in] | buf | Buffer for the result |
[in] | hclass | History class to use |
[in] | complete | Flags, see CompletionFlags |
[in] | comp_api | Auto-completion API |
[in] | cdata | Auto-completion private data |
0 | Selection made |
-1 | Aborted |
This function uses the message window.
Ask the user to enter a free-form string. This function supports auto-completion and saves the result to the history.
It also supports readline style text editing. See OpEditor for a list of functions.
Definition at line 274 of file window.c.
int mw_change_flag | ( | struct Mailbox * | m, |
struct EmailArray * | ea, | ||
bool | bf | ||
) |
Change the flag on a Message -.
m | Mailbox |
ea | Array of Emails to change |
bf | true: set the flag; false: clear the flag |
0 | Success |
-1 | Failure |
This function uses the message window.
Ask the user which flag they'd like to set/clear, e.g. Clear flag? (D/N/O/r/!):
Definition at line 454 of file flags.c.
int mw_enter_fname | ( | const char * | prompt, |
struct Buffer * | fname, | ||
bool | mailbox, | ||
struct Mailbox * | m, | ||
bool | multiple, | ||
char *** | files, | ||
int * | numfiles, | ||
SelectFileFlags | flags | ||
) |
Ask the user to select a file -.
[in] | prompt | Prompt |
[in] | fname | Buffer for the result |
[in] | mailbox | If true, select mailboxes |
[in] | multiple | Allow multiple selections |
[in] | m | Mailbox |
[out] | files | List of files selected |
[out] | numfiles | Number of files selected |
[in] | flags | Flags, see SelectFileFlags |
0 | Success |
-1 | Error |
This function uses the message window.
Allow the user to enter a filename. If they hit '?' then the browser will be started. See: dlg_browser()
Definition at line 236 of file curs_lib.c.
void mw_what_key | ( | void | ) |
Display the value of a key -.
This function uses the message window.
Displays the octal value back to the user. e.g. Char = h, Octal = 150, Decimal = 104
Press the $abort_key (default Ctrl-G) to exit.
Definition at line 499 of file curs_lib.c.
int mw_multi_choice | ( | const char * | prompt, |
const char * | letters | ||
) |
Offer the user a multiple choice question -.
prompt | Message prompt |
letters | Allowable selection keys |
>=1 | 1-based user selection |
-1 | Selection aborted |
This function uses a message window.
Ask the user a multiple-choice question, using shortcut letters, e.g. PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, s/(m)ime or (c)lear?
Colours:
color prompt
color options
Definition at line 63 of file question.c.
|
static |
Ask the user a Yes/No question offering help -.
prompt | Prompt |
def | Default answer, e.g. MUTT_YES |
cdef | Config definition for help |
flags | mutt_getch Flags, e.g. GETCH_IGNORE_MACRO |
enum | QuadOption, Selection made |
This function uses a message window.
Ask the user a yes/no question, using shortcut letters, e.g. Quit NeoMutt? ([yes]/no):
This question can be answered using locale-dependent letters, e.g.
[+1yY]
or [-0nN]
[+1yYdDДд]
or [-0nNНн]
If a config variable (cdef) is given, then help is offered. The options change to: ([yes]/no/?)
Pressing '?' will show the name and one-line description of the config variable. Additionally, if $help
is set, a link to the config's documentation is shown.
Definition at line 174 of file question.c.