It was on D (as in uppercase D, or shift-d), but I feel this was going to be
confusing given that there is still this slight mixup with the display of
letters in the footer, and what was bound, etc.
So... make it obvious what to press.
Remember, 'd' can't be used because it's a movement key in this game.
See https://github.com/Textualize/textual/pull/963#discussion_r1000546514
Personally I prefer the approach I was using in that it's one less bit of
hard-coded metadata. On the other hand I can appreciate that reducing the
number of possibly-confusing things in an example plays better with people
who may be both new to Textual *and* to Python.
Because Textual uses on_ for event handlers there was the danger of a name
clash; so to keep things as clear as possible this renames anything to do
with "on" (method names, properties, style classes) so that it talks about
"filled" instead.
See https://github.com/Textualize/textual/pull/963#discussion_r1000544563
It had been suggested to me that these would be needed, but in testing here
I'm not seeing that. So, until I find out otherwise, let's simplify things
and drop that.
Originally I was doing everything in the DOM, using just the primitive
widgets. Given that I recently created an actual GameCell widget (which
simply inherits from a Button, but still...) it makes sense to now have
row/col properties as part of that.
Originally it was partially correct in that it did sound the bell, but it
also then exited the application and printed the details of the button --
the text didn't mention the latter aspect. This corrects that and removes
mention of the bell sound because we've now removed that.
While in this part of the docs we do want to keep the bell (see key02), it
was an error in the code that it included this event in key01. Removing it
from here because adding this bit of code for key02 is a key (no pun) part
of the docs.
Don't ping the terminal bell on every key-press. This might be okay on some
systems, on others (we're looking at you Windows) it's a wee bit
distracting.
See #955.
Addresses the issue raised in #939. Here I rework Screen._reset_focus so
that, rather than deal with siblings, it deals with the focus chain. It now
also optionally takes a list of DOMNodes to avoid and will, as that
suggests, avoid them when looking for somewhere to move focus to.
As a preference the new version of this will seek to settle focus on the
nearest (in the chain) *previous* non-excluded DOMNode.
NOTE: Currently the return value of Widget.walk_children is cast to a list
to ensure that it doesn't get consumed (as of the time of commit, it's still
qan iterable). Once https://github.com/Textualize/textual/pull/952 has been
accepted I'll change this (remove the cast).
This change ensures that, for example, the widget remains in the
Screen.focus_chain so that it's easier to handle passing off focus on
removal.
To help address #939.
Originally it returned an iterable, building that up from a list anyway. In
local discussion it's been decided that it makes more sense to simply return
the list. There's no obvious advantage to doing it a different way.