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

Make BindableProperty add to bindable_properties #4114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nicegui/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def bind_to(self_obj: Any, self_name: str, other_obj: Any, other_name: str, forw
:param other_name: The name of the property to bind to.
:param forward: A function to apply to the value before applying it.
"""
_set_attribute(self_obj, self_name, _get_attribute(self_obj, self_name))
bindings[(id(self_obj), self_name)].append((self_obj, other_obj, other_name, forward))
if (id(self_obj), self_name) not in bindable_properties:
active_links.append((self_obj, self_name, other_obj, other_name, forward))
Expand All @@ -107,6 +108,7 @@ def bind_from(self_obj: Any, self_name: str, other_obj: Any, other_name: str, ba
:param other_name: The name of the property to bind from.
:param backward: A function to apply to the value before applying it.
"""
_set_attribute(other_obj, other_name, _get_attribute(other_obj, other_name))
bindings[(id(other_obj), other_name)].append((other_obj, self_obj, self_name, backward))
if (id(other_obj), other_name) not in bindable_properties:
active_links.append((other_obj, other_name, self_obj, self_name, backward))
Expand Down