Re: container widget with background



Guido Volpi wrote:

I don't know how draw a background (ie. a jpeg image) in a fixed layout
container. Everyone coul ask me something?

You can load image from file to GdkPixbuf with gdk_pixbuf_new_from_file():
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-file-loading.html

Optionally scale it with gdk_pixbuf_scale():
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-scaling.html

Then create GdkPixmap with gdk_pixbuf_render_pixmap_and_mask():
http://developer.gnome.org/doc/API/2.0/gdk/gdk-pixbufs.html#GDK-PIXBUF-RENDER-PIXMAP-AND-MASK

And finally set it as a window background with gdk_window_set_back_pixmap:
gdk-windows.html#GDK-WINDOW-SET-BACK-PIXMAP

*NOTE* not all widgets in GTK have their own windows.

Olexiy





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