summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-12-17 15:13:43 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-12-17 15:13:43 +0000
commite71f6b0bc073584015e9bd5ea77ad9557ff61be8 (patch)
treeb07e76be685302e1c935dd5b773434deb2b84c90
parent1738724e4a9dfe8a8d3e8f7209e24c2afcf77560 (diff)
downloadgtk+-e71f6b0bc073584015e9bd5ea77ad9557ff61be8.tar.gz
docs: Note the caveat on GtkEditable signals with delegates
We cannot bubble up ::insert-text and ::delete-text signals from the delegate to the wrapper editable without causing an infinite recursion, due to how the signals are designed; ideally, we would have decoupled signal emission from virtual functions *before* releasing GTK4, but now that we have, we can't break the contract.
-rw-r--r--gtk/gtkeditable.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c
index eae161c542..48ae98dd20 100644
--- a/gtk/gtkeditable.c
+++ b/gtk/gtkeditable.c
@@ -133,8 +133,8 @@
* }
* ]|
*
- * Finally, use gtk_editable_delegate_set_property() in your set_property
- * function (and similar for get_property), to set the editable properties:
+ * Finally, use gtk_editable_delegate_set_property() in your `set_property`
+ * function (and similar for `get_property`), to set the editable properties:
*
* |[
* ...
@@ -144,6 +144,14 @@
* switch (prop_id)
* ...
* ]|
+ *
+ * It is important to note that if you create a GtkEditable that uses a delegate,
+ * the low level #GtkEditable::insert-text and #GtkEditable::delete-text signals
+ * will be propagated from the "wrapper" editable to the delegate, but they will
+ * not be propagated from the delegate to the "wrapper" editable, as they would
+ * cause an infinite recursion. If you wish to connect to the #GtkEditable::insert-text
+ * and #GtkEditable::delete-text signals, you will need to connect to them on
+ * the delegate obtained via gtk_editable_get_delegate().
*/
#include "config.h"