Bug 608993 - Add gtk_widget_style_attach()

As replacement for:
widget->style = gtk_style_attach (widget->style, widget->window);
This commit is contained in:
Michael Natterer 2010-02-04 16:43:54 +01:00 committed by Tristan Van Berkom
parent 0a037fa4fe
commit 9dfadca46c
3 changed files with 34 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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);