]> granicus.if.org Git - nethack/commit
X11 menus - support pre-selected menu entries
authorPatR <rankin@nethack.org>
Sun, 31 Jan 2016 03:39:29 +0000 (19:39 -0800)
committerPatR <rankin@nethack.org>
Sun, 31 Jan 2016 03:39:29 +0000 (19:39 -0800)
commit757c51bb3c2e28f429533caadfea178d678e038d
tree9fbbf0bfcdb2bb490581a96a3c75a7f30812a54d
parentdf41e8f203eb8cab77d33acbad1bbf1d2d7d5608
X11 menus - support pre-selected menu entries

X11 had been ignoring add_menu(..., MENU_SELECTED) to specify a
pre-selected menu entry.  This adds support for that.

Attempt to implement pre-selected entry for PICK_ONE menu sanely by
returning the pre-selected entry instead of toggling it off if the
user chooses it explicitly.   Inner workings of menus are convoluted
so I'm not sure it's 100% correct, although testing hasn't found any
problems.  (tty currently returns 0 for "nothing picked" when
explicitly picking a pre-selected entry in a PICK_ONE menu, and the
core jumps through hoops to handle it.  That can't be cleaned up until
all interfaces which support pre-selected entries achieve sanity.)

Make "random" be chosen for <return> or <enter> during role selection
and highlight it to reflect that.  (Role selection for X11 uses its
own code instead of nethack menus, so pre-selection isn't applicable.)
doc/fixes36.1
include/winX.h
win/X11/winmenu.c
win/X11/winmisc.c