called by core to have the player pick an extended command */
| 1558 | |
| 1559 | /* called by core to have the player pick an extended command */ |
| 1560 | int |
| 1561 | X11_get_ext_cmd(void) |
| 1562 | { |
| 1563 | if (iflags.extmenu != ec_full_list) { |
| 1564 | /* player has toggled the 'extmenu' option, toss the old widgets */ |
| 1565 | if (extended_commands) |
| 1566 | release_extended_cmds(); /* will set extended_commands to Null */ |
| 1567 | ec_full_list = iflags.extmenu; |
| 1568 | } |
| 1569 | if (!extended_commands) |
| 1570 | init_extended_commands_popup(); |
| 1571 | |
| 1572 | extended_cmd_selected = -1; /* reset selected value */ |
| 1573 | ec_scroll_to_view(-1); /* force scroll bar to top */ |
| 1574 | |
| 1575 | positionpopup(extended_command_popup, FALSE); /* center on cursor */ |
| 1576 | nh_XtPopup(extended_command_popup, (int) XtGrabExclusive, |
| 1577 | extended_command_form); |
| 1578 | |
| 1579 | /* The callbacks will enable the event loop exit. */ |
| 1580 | (void) x_event(EXIT_ON_EXIT); |
| 1581 | |
| 1582 | if (extended_cmd_selected < 0) { |
| 1583 | return -1; |
| 1584 | } |
| 1585 | return command_indx[extended_cmd_selected]; |
| 1586 | } |
| 1587 | |
| 1588 | void |
| 1589 | release_extended_cmds(void) |
nothing calls this directly
no test coverage detected