hm if we save the default style, we should also provide a function to

Sun Mar  1 18:41:07 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
        default style, we should also provide a function to restore it ;).

        * gtk/main.[hc]: small fixups to idle handlers, added support for quit
        handlers.
This commit is contained in:
Tim Janik 1998-03-01 17:44:24 +00:00 committed by Tim Janik
parent 16da0508af
commit 2a9e933d90
9 changed files with 79 additions and 0 deletions

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -1,3 +1,11 @@
Sun Mar 1 18:41:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtkwidget.c (gtk_widget_restore_default_style): hm if we save the
default style, we should also provide a function to restore it ;).
* gtk/main.[hc]: small fixups to idle handlers, added support for quit
handlers.
Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu> Sun Mar 1 05:18:11 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch] * gtk/gtkentry.c gtk/gtktext.c gtkeditable.[ch]

View File

@ -25,6 +25,11 @@ gtk_widget_set_rc_style ()
restore the default style otherwise. restore the default style otherwise.
This will override a previously set user style or rc style. This will override a previously set user style or rc style.
gtk_widget_restore_default_style ()
Reset the widget's style to the default style, this is only usefull if
the widgets default style had been saved by previous calls to
gtk_widget_set_style() or gtk_widget_set_rc_style().
gtk_widget_ensure_style () gtk_widget_ensure_style ()
Ensure taht the widget either has a user style set, or an rc lookup Ensure taht the widget either has a user style set, or an rc lookup
has been performed. has been performed.

View File

@ -2411,6 +2411,24 @@ gtk_widget_set_rc_style (GtkWidget *widget)
} }
} }
void
gtk_widget_restore_default_style (GtkWidget *widget)
{
GtkStyle *default_style;
g_return_if_fail (widget != NULL);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
default_style = gtk_object_get_data (GTK_OBJECT (widget), saved_default_style_key);
if (default_style)
{
gtk_object_remove_data (GTK_OBJECT (widget), saved_default_style_key);
gtk_widget_set_style_internal (widget, default_style, FALSE);
gtk_style_unref (default_style);
}
}
GtkStyle* GtkStyle*
gtk_widget_get_style (GtkWidget *widget) gtk_widget_get_style (GtkWidget *widget)
{ {