Re: [pygtk] libglade bug?

2009-05-05 Thread Rob Brown-Bayliss
On Tue, 2009-05-05 at 19:16 +1200, Rob Brown-Bayliss wrote:

> On Mon, 2009-05-04 at 20:06 +1200, Rob Brown-Bayliss wrote:
> 
> I have tracked it down to a bug in glade.  I am using Glade 3.6.1 on
> Ubuntu 9.04


There is a build of Glade 3.6.3 which appears to fix the problem.

-- 
Rob Brown-Bayliss 
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] libglade bug?

2009-05-05 Thread Rob Brown-Bayliss
On Mon, 2009-05-04 at 20:06 +1200, Rob Brown-Bayliss wrote:

I have tracked it down to a bug in glade.  I am using Glade 3.6.1 on
Ubuntu 9.04

What has been happening is each time I change the UI via glade, it has
been removing the signal for the delete-event and destroy-event from the
xml file it saves:

   True

###  This line not saved
###
This line not saved

  

so when I do:

self.siglist = {"on_refresh_toolbutton_clicked":
self.request_refresh,
"on_quit1_activate": 
self.on_quit1_activate,
"on_app1_destroy_event": 
self.on_app1_delete_event,
"on_app1_delete_event": 
self.on_app1_delete_event}
self.wtree.signal_autoconnect(self.siglist)

there is no signal to connect to on_app1_delete_event so the window gets
destroyed, hence no widget to check the value of etc...


I will report to the maintainers.

-- 
Rob Brown-Bayliss 

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

Re: [pygtk] libglade bug?

2009-05-04 Thread Hrvoje Niksic
Rob Brown-Bayliss wrote:
> print "="
> print "Count =  " + str(self.check_count)
> self.check_count += 1
> print self.wtree.get_widget("label_checkbutton")
> print "="
> if self.wtree.get_widget("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'

It's very likely a case of bug #546802, 
http://bugzilla.gnome.org/show_bug.cgi?id=546802

A known workaround is to access the dict of the widget, simply using:

self.wtree.__dict__
self.wtree.get_widget('label_checkbutton')__dict__

Does anyone know if the latest PyGTK has this bug fixed?  We encounter 
it frequently during in-house development.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] libglade bug?

2009-05-04 Thread Timo
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
> 
> =
> =
> Count =  42
> 
> =
> =
> Count =  43
> 
> =
> =
> 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  >
>
> 
>
> ___
> 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/


[pygtk] libglade bug?

2009-05-04 Thread Rob Brown-Bayliss

Hi,

I have this code being called every few minutes by a gkt timeout
function:

print "="
print "Count =  " + str(self.check_count)
self.check_count += 1
print self.wtree.get_widget("label_checkbutton")
print "="
if 
self.wtree.get_widget("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

=
=
Count =  42

=
=
Count =  43

=
=
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 
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/