After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 122966 - GtkCellRendererPixbuf bug
GtkCellRendererPixbuf bug
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2003-09-22 19:39 UTC by [ATR]Dj-Death
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A little example to cleary show what's the problem. (1.59 KB, text/plain)
2003-10-14 19:21 UTC, [ATR]Dj-Death
Details

Description [ATR]Dj-Death 2003-09-22 19:39:42 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.
Comment 1 [ATR]Dj-Death 2003-10-14 19:21:10 UTC
Created attachment 20704 [details]
A little example to cleary show what's the problem.
Comment 2 Kristian Rietveld 2003-12-17 22:56:53 UTC
Fixed on HEAD. (not on stable).

Thanks for the testcase.