-
-
Notifications
You must be signed in to change notification settings - Fork 785
[widget audit] toga.Table #2011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6eb5d02 to
de35b5a
Compare
de35b5a to
399baf3
Compare
|
|
||
| A custom ListSource must also generate ``insert``, ``remove`` and ``clear`` | ||
| notifications when items are added or removed from the source. | ||
| A custom ListSource must also inherit from :any:`Source`, and generate ``insert``, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting case of a subtle duck-typing change. The previous implementation would have allowed any object that honoured the (implicit) Source protocol; as a result of the tweak you made to core, the default behavior is "list like", and a Source must literally inherit from source, and any other type will be coerced (to varying degrees of success) into a ListSource. This then implies that ListSource will be robust to all possible input types, which I don't think is necessarily true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion, we agreed:
-
The ListSource constructor already accepts any iterable.
-
We need some way for the user to distinguish an iterable which is to be used as a Source directly, versus copied into a new ListSource. Inheriting the Source class is the simplest way of doing this.
-
The statement "Any object that adheres to the collections.abc.MutableSequence protocol can be used as a data source" isn't really true, because:
- The
findmethod isn't part of the standard Sequence API. - There are also differences in whether the other methods use identity versus equality, as discussed in [widget Audit] toga.Selection #1955.
So this wording should instead refer to the ListSource API directly, and that API documentation should include all the relevant dunder methods. Later we may redefine it as a Protocol.
- The
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
| if ctrl: | ||
| key_code = "^" + key_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out the Winforms ListView doesn't have a built-in select-all key combination, but I'll leave this here in case it's useful in the future.
|
Android issues:
|
Audit of Table.
Includes an audit of Icon as well, because Icons can be used in tables.
Builds on #1955 because of dependencies on ListSource.
on_double_clicktoon_activateto avoid a specific GUI action.add_columnin favor of a full insert/append capability.Fixes:
Tableputs it in an unstable state #2007ListSourceon Android does not work #2070Related:
GTK.TreeIterRaisesDeprecationWarning#1993ListSourceAPIs #2071Audit checklist