Created
August 13, 2009 07:53
-
-
Save yurenju/167040 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
set_event_box_background (GtkWidget *event_box) | |
{ | |
GError *error = NULL; | |
const gchar *file_path = g_strjoin ("/", PKGDATADIR, "images", "slider_bg.png", NULL); | |
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (file_path, &error); | |
GdkPixmap *pixmap = NULL; | |
GdkPixmap *mask = NULL; | |
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 255); | |
GtkStyle *orig_style = gtk_widget_get_style (event_box); | |
GtkStyle *style = gtk_style_copy (orig_style); | |
style->bg_pixmap[GTK_STATE_NORMAL] = pixmap; | |
gtk_widget_set_style (event_box, style); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment