Skip to content
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

Add API to replace children #2301 #2591

Merged
merged 7 commits into from
May 22, 2024
Merged

Conversation

funkyrailroad
Copy link
Contributor

@funkyrailroad funkyrailroad commented May 22, 2024

Added replace and index methods to base widget class and minimal test cases.
Added another test case to verify the functionality of children access/assignment via square bracket notation __setitem__/ __getitem__.

This allows users to replace a child widget with another with a single method, instead of needing to remove the old one, keep track of the index, and insert a new one.

Fixes #2301

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor documentation tweaks, but otherwise, this looks great! Thanks for the fix!

changes/2301.feature.rst Outdated Show resolved Hide resolved
core/src/toga/widgets/base.py Outdated Show resolved Hide resolved
@freakboy3742
Copy link
Member

If you're still at the sprints, don't forget to come by and get your challenge coin!

@freakboy3742 freakboy3742 merged commit 207941a into beeware:main May 22, 2024
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API to replace children
2 participants