I compiled a list of all widget methods that return 'None' and for which it _could_ make sense to make this change.
(I filtered out some methods, like watch and action methods.)
I tried choosing a subset of those methods, trying to only pick methods for which there weren't two things that could be returned (e.g., 'Widget.move_child' _could_ return either the widget or the child that was moved) and I also tried to only pick methods that have little or no parameters (e.g., 'Widget.animate' has many parameters and is typically called with quite a few.
These are all the 'Widget' methods for which this could make sense:
- 'move_child' (either return 'self' or the actual 'child' that was moved…)
- 'animate'
- 'scroll_to' / 'scroll_relate' / 'scroll_home' / 'scroll_end' / 'scroll_left' / 'scroll_right' / 'scroll_down' / 'scroll_up' / 'scroll_page_up' / 'scroll_page_down' / 'scroll_page_left' / 'scroll_page_right' / 'scroll_visible'
- 'refresh'
- 'focus' / 'reset_focus'
- 'capture_mouse' / 'release_mouse'
Additionally, I looked at each widget, and found these methods:
- 'Tree'
- 'TreeNode'
- 'expand' / 'expand_all' / 'collapse' / 'collapse_all' / 'toggle' / 'toggle_all'
- 'set_label'
- 'clear' / 'reset'
- 'select_node' (either return 'self' or the actual 'node' that was selected)
- 'scroll_to_line' / 'scroll_to_node'
- 'refresh_line'
- 'ToggleButton'
- 'toggle' (and 'action_toggle'?)
- 'TextLog'
- 'write'
- 'clear'
- 'Tabs'
- 'add_tab' / 'remove_tab'
- 'clear'
- 'Switch'
- 'toggle' (and 'action_toggle'?)
- 'Static'
- 'update'
- 'Pretty'
- 'update'
- 'Placeholder'
- 'cycle_variant'
- '_markdown.py'
- 'MarkdownBlock'
- 'set_content'
- 'MarkdownTableOfContents'
- 'set_table_of_contents'
- 'Input'
- 'insert_text_at_cursor'
- 'DirectoryTree'
- 'load_directory'
- 'DataTable'
- 'update_cell' / 'update_cell_at'
- 'clear'
- 'refresh_coordinate' / 'refresh_row' / 'refresh_column'
- 'sort'
- 'Button'
- 'press'
Related issues: #1908
Related discussions: #1817
* Remove _clock.py::sleep.
* Move _clock.py::get_time_no_wait to _time.py.
* Move _clock.py::get_time to _time.py.
* Remove async version of _time.py::get_time.
We started by removing '_time.py::get_time' because that was the async one and then I renamed 'get_time_no_wait' to 'get_time'.
* Make 'get_time' just an alias.
The start of what will hopefully become a one-stop comprehensive test of all
the fun corners of stylesheet parsing. While not intended to replace all the
other unit tests for CSS, this test should help to quickly and easily be
sure that nothing breaks any valid CSS.
Influenced by #1253 and #1836 this code starts the process of implementing
the requirement outlined in #1838.
Adding more rules -- simple and/or weird -- that are expected and known to
parse without a problem is encouraged.
Initially this was "throw most if not all widgets at the display and disable
everything" test; but in #2028 it was requested that this be simplified,
just using the same widget, in enabled and disabled states.
Button seems like a good choice here.
To ensure that things work as intended, I'm going with the approach of
disabling via a container as that's one big change that the disabled
facility brought in.