Widgets with background image



Hello everyone,

I have a set of widgets grouped into a boxes and I need to set the background image for those widgets. The idea is to create something like the attached screenshot. I tried setting the style of the topmost GtkBox that encapsulates buttons, but apparently GtkBox doesn't support background image... I also tried via gtkrc.

static void set_backg_image(GtkWidget *w, const char *image_path)
{
    GdkPixmap *background;
    GdkPixbuf *pixbuf;
    GtkStyle *style;
    GError *error = NULL;

    pixbuf = gdk_pixbuf_new_from_file(image_path, &error);
    gdk_pixbuf_render_pixmap_and_mask(pixbuf, &background, NULL, 0);
    style = gtk_style_new();
    style->bg_pixmap[0] = background;
    gtk_widget_set_style(GTK_WIDGET(w), GTK_STYLE(style));
    gtk_container_set_border_width(GTK_CONTAINER(w), 10);
}

So the question is can you give me some clue on how to set the background of a set of widgets?
Is there other widget I can use to do it?

Thank you,

--
Eduardo Fiss Beloni
Programmer
Office: +55 53 3229 4005
eduardo pheitec com
www.pheitec.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]