Ticket #3544 (closed defect: fixed)

Opened 13 months ago

Last modified 13 months ago

gtk.CellView AttributeError on startup

Reported by: bluegraydragon@… Owned by: asterix
Priority: normal Milestone: 0.11.3
Component: None Version:
Severity: minor Keywords:
Cc: OS: Unix

Description

Traceback (most recent call last):

File "/home/ivanova/devel/gajim/src/cell_renderer_image.py", line 70, in animation_timeout

model = tree.get_model()

AttributeError?: 'gtk.CellView?' object has no attribute 'get_model'

Attachments

Change History

Changed 13 months ago by asterix

could you open cell_renderer_image.py and add a print tree line 70:

      iter = self.iters[image]
      iter.advance()
      print tree
      model = tree.get_model()
      if model:
         model.foreach(self.func, (image, tree))

And copy here the result of the print just before the traceback

Changed 13 months ago by anonymous

<gtk.TreeView? object (GtkTreeView?) at 0xb5eda0cc> <gtk.CellView? object (GtkCellView?) at 0xb5ee1784> Traceback (most recent call last):

File "/home/ivanova/devel/gajim/src/cell_renderer_image.py", line 71, in animation_timeout

model = tree.get_model()

AttributeError?: 'gtk.CellView?' object has no attribute 'get_model' <gtk.TreeView? object (GtkTreeView?) at 0xb5eda0cc> <gtk.TreeView? object (GtkTreeView?) at 0xb5eda0cc>

Changed 13 months ago by asterix

hmm ok the on_render function sometime get the CellView? object, sometime the TreeView? object. Documentation says:

"the widget owning window"

I have no idea why the owner changes. As a workarrount could you try this patch that ignore the event if widget is not the treeview:

Index: cell_renderer_image.py
===================================================================
--- cell_renderer_image.py      (revision 8945)
+++ cell_renderer_image.py      (working copy)
@@ -94,6 +94,8 @@
 
                if self.image.get_storage_type() == gtk.IMAGE_ANIMATION:
                        if self.image not in self.iters:
+                               if not isinstance(widget, gtk.TreeView):
+                                       return
                                animation = self.image.get_animation()
                                iter =  animation.get_iter()
                                self.iters[self.image] = iter

BTW which version of GTK and PyGTK do you have? (help -> about)

Changed 13 months ago by anonymous

Yup, the workaround works. thanks I have: GTK+ Version: 2.10.1 PyGTK Version: 2.10.6

Changed 13 months ago by asterix

ok that's very strange that only you get this error. This cellrenderer is here and untouched for years. You still see animated inames in your roster? If Yess I'll commit this workarround

Changed 13 months ago by anonymous

What are animated inames? But yeah, everything seems to be working fine.

Changed 13 months ago by asterix

I meant 'images' :)

Changed 13 months ago by anonymous

Where in the roster can I see animated images? But images are all showing fine as far as I can see - trayicon animation, emoticon animation etc. etc.

Changed 13 months ago by anonymous

it depends on the iconset you use. for example, with sun iconset, when you get a message and don't auto popup it, you see an animated icon in roster (the same as in trayicon)

Changed 13 months ago by anonymous

ahh of course ;). All working fine.

Changed 13 months ago by asterix

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 0.12

(In [8952]) prevent TB in cell_renderer_pixbuf. fixes #3544

Changed 13 months ago by asterix

  • milestone changed from 0.12 to 0.11.3

Add/Change #3544 (gtk.CellView AttributeError on startup)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.