[gtk+] docs: GtkWidget::style-updated vs GtkStyleContext::changed



commit af5ef152b1c1949f580e96fa0ef125a96ece878e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jul 24 17:20:29 2016 +0200

    docs: GtkWidget::style-updated vs GtkStyleContext::changed
    
    Explain the difference between those two signals.
    
    Add "Since: 3.0" for GtkStyleContext::changed, since that signal has
    been added in commit 9f84e101bf150a85f82e15c56130b1f98b8fdbf0, present
    since 2.91.6.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769047

 gtk/gtkstylecontext.c |   13 +++++++++++++
 gtk/gtkwidget.c       |    9 ++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index a6191bd..03a16aa 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -201,6 +201,19 @@ gtk_style_context_class_init (GtkStyleContextClass *klass)
 
   klass->changed = gtk_style_context_real_changed;
 
+  /**
+   * GtkStyleContext::changed:
+   *
+   * The ::changed signal is emitted when there is a change in the
+   * #GtkStyleContext.
+   *
+   * For a #GtkStyleContext returned by gtk_widget_get_style_context(), the
+   * #GtkWidget::style-updated signal/vfunc might be more convenient to use.
+   *
+   * This signal is useful when using the theming layer standalone.
+   *
+   * Since: 3.0
+   */
   signals[CHANGED] =
     g_signal_new (I_("changed"),
                   G_TYPE_FROM_CLASS (object_class),
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 52a9995..cf9e4c6 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -1903,9 +1903,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
    * GtkWidget::style-updated:
    * @widget: the object on which the signal is emitted
    *
-   * The ::style-updated signal is emitted when the #GtkStyleContext
-   * of a widget is changed. Note that style-modifying functions like
-   * gtk_widget_override_color() also cause this signal to be emitted.
+   * The ::style-updated signal is a convenience signal that is emitted when the
+   * #GtkStyleContext::changed signal is emitted on the @widget's associated
+   * #GtkStyleContext as returned by gtk_widget_get_style_context().
+   *
+   * Note that style-modifying functions like gtk_widget_override_color() also
+   * cause this signal to be emitted.
    *
    * Since: 3.0
    */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]