[pygtk] libglade bug?
Timo
timomlists at gmail.com
Mon May 4 16:58:31 WST 2009
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.bayliss at gmail.com
> <mailto:r.brown.bayliss at gmail.com>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
More information about the pygtk
mailing list