gtk/demos/gtk-demo/theming_style_classes.c
Benjamin Otte 07164e098a window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.

Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
2017-10-31 08:25:37 +01:00

45 lines
1.3 KiB
C

/* Theming/Style Classes
*
* GTK+ uses CSS for theming. Style classes can be associated
* with widgets to inform the theme about intended rendering.
*
* This demo shows some common examples where theming features
* of GTK+ are used for certain effects: primary toolbars,
* inline toolbars and linked buttons.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
GtkWidget *
do_theming_style_classes (GtkWidget *do_widget)
{
GtkWidget *grid;
GtkBuilder *builder;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
builder = gtk_builder_new_from_resource ("/theming_style_classes/theming.ui");
grid = (GtkWidget *)gtk_builder_get_object (builder, "grid");
gtk_container_add (GTK_CONTAINER (window), grid);
g_object_unref (builder);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}