Skip to content

Commit a1159a4

Browse files
authored
Merge pull request #18226 from QuLogic/widget-cbs
Use CallbackRegistry in Widgets and some related cleanup
2 parents 035bf30 + ae888ca commit a1159a4

File tree

3 files changed

+136
-110
lines changed

3 files changed

+136
-110
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Widgets use ``CallbackRegistry`` to save callbacks
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
`.Widget`\s with event observers now use a `.CallbackRegistry` for storing
5+
callbacks. This is consistent with canvas event callbacks, and fixes some bugs
6+
in widget callback handling.
7+
8+
Due to this change, callback methods are now stored as weak references, which
9+
means you must keep a reference to the associated object. Otherwise it may be
10+
garbage collected.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Widget class internals
2+
~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Several `.widgets.Widget` class internals have been privatized and deprecated:
5+
6+
* ``AxesWidget.cids``
7+
* ``Button.cnt`` and ``Button.observers``
8+
* ``CheckButtons.cnt`` and ``CheckButtons.observers``
9+
* ``RadioButtons.cnt`` and ``RadioButtons.observers``
10+
* ``Slider.cnt`` and ``Slider.observers``
11+
* ``TextBox.cnt``, ``TextBox.change_observers`` and
12+
``TextBox.submit_observers``

0 commit comments

Comments
 (0)