GNOME Bugzilla – Bug 122966
GtkCellRendererPixbuf bug
Last modified: 2011-02-04 16:16:03 UTC
Hi, I'm writing a little app using GTK+, and I recently found something quite strange in the GtkCellRendererPixbuf. By using the "stock_id" property to display stock icons, I found that if you set this one cell with the linked porperty to NULL, it will draws an icon anyway. Using the last used icon. When giving information to the cell renderer, the icon is set to the GtkCellRendererPixbuf get the icon from the stock and store it in cellpixbuf->pixbuf (the stock id is stored in cellpixbuf->stock_id), but when switching to the next cell to redraw, the GtkCellRendererPixbuf doesn't clear his variables. So when it check if (cellpixbuf->pixbuf != NULL) it's TRUE ! And so it redraw the cell with the previous pixbuf, even if cellpixbuf->stock_id is NULL. Note that if you have the "pixbuf" property linked you won't have this problem, because cellpixbuf->pixbuf is set for every cell, even if you don't explicitly specify his value in the GtkTreeStore. The solution should be to not store the pixbuf of the stock in pixbuf variable of the GtkCellRenderPixbuf structure. Regards.
Created attachment 20704 [details] A little example to cleary show what's the problem.
Fixed on HEAD. (not on stable). Thanks for the testcase.