Commit 9dfadca4 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Tristan Van Berkom

Bug 608993 - Add gtk_widget_style_attach()

As replacement for:
widget->style = gtk_style_attach (widget->style, widget->window);
parent 0a037fa4
......@@ -5242,6 +5242,7 @@ gtk_widget_show_now
gtk_widget_size_allocate
gtk_widget_size_request
gtk_widget_get_desired_size
gtk_widget_style_attach
gtk_widget_style_get G_GNUC_NULL_TERMINATED
gtk_widget_style_get_property
gtk_widget_style_get_valist
......
......@@ -6308,6 +6308,32 @@ gtk_widget_get_parent (GtkWidget *widget)
* see docs/styles.txt
*****************************************/
/**
* gtk_widget_style_attach:
* @widget: a #GtkWidget
*
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* and should only ever be called in a derived widget's "realize"
* implementation which does not chain up to its parent class'
* "realize" implementation, because one of the parent classes
* (finally #GtkWidget) would attach the style itself.
*
* Since: 2.20
**/
void
gtk_widget_style_attach (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
widget->style = gtk_style_attach (widget->style, widget->window);
}
/**
* gtk_widget_has_rc_style:
* @widget: a #GtkWidget
......
......@@ -1069,11 +1069,13 @@ gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
/* Widget styles.
*/
gboolean gtk_widget_has_rc_style (GtkWidget *widget);
void gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style);
void gtk_widget_ensure_style (GtkWidget *widget);
GtkStyle* gtk_widget_get_style (GtkWidget *widget);
void gtk_widget_style_attach (GtkWidget *style);
gboolean gtk_widget_has_rc_style (GtkWidget *widget);
void gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style);
void gtk_widget_ensure_style (GtkWidget *widget);
GtkStyle * gtk_widget_get_style (GtkWidget *widget);
void gtk_widget_modify_style (GtkWidget *widget,
GtkRcStyle *style);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment