Rob Brown-Bayliss schreef:
>
> Hi,
>
> I have this code being called every few minutes by a gkt timeout function:
You can try to put this in your __init__()
self.label_checkbutton = self.wtree.get_widget("label_checkbutton")

Then you don't need to get the widget everytime and it cannot fail.

>
> print "====================================="
> print "Count =  " + str(self.check_count)
> self.check_count += 1
> print self.wtree.get_widget("label_checkbutton")
This line would be then:
print self.label_checkbutton
> print "====================================="
> if self.wtree.get_widget("label_checkbutton").get_active():
And this one:
if self.label_checkbutton.get_active():
>                             << some code cut>>
>
> It has been working fine for a very long time, then I upgraded to 
> ubuntu 9.04, and started getting this error:
>
> AttributeError: 'NoneType' object has no attribute 'get_active'
>
>
> And here is the output prior to the error:
>
> =====================================
> Count =  41
> <gtk.CheckButton object at 0x97909dc (GtkCheckButton at 0x9806910)>
> =====================================
> =====================================
> Count =  42
> <gtk.CheckButton object at 0x97909dc (GtkCheckButton at 0x9806910)>
> =====================================
> =====================================
> Count =  43
> <gtk.CheckButton object at 0x97909dc (GtkCheckButton at 0x9806910)>
> =====================================
> =====================================
> Count =  44
> None
> =====================================
>
>
> Some times it fails first run, somtimes after 3 or 4 iterations, other 
> times it goes for hours...
>
> Any clues?  am I calling the get_active incorectly?
>
> -- 
> Rob Brown-Bayliss <r.brown.bayl...@gmail.com 
> <mailto:r.brown.bayl...@gmail.com>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to