|
|
| Author |
Message |
|
|
cnu_sree GTK+ Geek
Joined: 06 Oct 2006 Posts: 57
|
Posted: Thu Apr 05, 2007 8:36 am Post subject: background image for gtktreeview |
|
|
i added background image to gtktreeview using
g_signal_connect (G_OBJECT (G_ContactList), "realize",
G_CALLBACK (contactlist_background_cb), NULL);
void contactlist_background_cb (GtkWidget *treeview, gpointer user_data)
{
GdkWindow *window = gtk_tree_view_get_bin_window (view);
gchar *image="background.bmp";
if (!image) {
gdk_window_clear (window);
return;
}
GError *error = 0;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (image, &error);
if (!pixbuf) {
g_warning ("could not open background image: '%s'"
" - %s", image, error->message);
return;
}
GdkPixmap *pixmap;
gdk_pixbuf_render_pixmap_and_mask_for_colormap (pixbuf,
gdk_drawable_get_colormap (GDK_DRAWABLE (window)), &pixmap, NULL, 0);
g_object_unref (G_OBJECT (pixbuf));
gdk_window_set_back_pixmap (window, pixmap, FALSE);
}
but my problem is when i add item to treeview the background image is not displaying
how can i display the image and also treeview items
thank u
sree |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
|
| Back to top |
|
 |
cnu_sree GTK+ Geek
Joined: 06 Oct 2006 Posts: 57
|
Posted: Fri Apr 06, 2007 7:58 am Post subject: |
|
|
thank u
but i didnot find any function in gtkstyle like bg_pixamp.
can u tell the function which we can apply the all states to gtktreeview for background image.
thank u
sree |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
Posted: Fri Apr 06, 2007 10:10 pm Post subject: |
|
|
| You don't need a function ... just edit the variable. |
|
| Back to top |
|
 |
cnu_sree GTK+ Geek
Joined: 06 Oct 2006 Posts: 57
|
Posted: Sat Apr 14, 2007 11:54 am Post subject: |
|
|
plzz can u show we how can i edit tht variable .
thank u
sree |
|
| Back to top |
|
 |
|