[pygtk] signal_autoconnect weirdness
Damien Elmes
resolve@repose.cx
07 Feb 2002 05:19:51 +1100
Christian Robottom Reis <kiko@async.com.br> writes:
> On 5 Feb 2002, Damien Elmes wrote:
>
> > Basically I store callbacks in a class, and use an instance to share data.
> > To enable all my callbacks, I'd do something like this:
> >
> > for key in PlaylistWindow.__dict__.keys():
> [...]
> > self.xml.signal_autoconnect(dict)
> >
> > Which seems to work fine in the old pygtk. I've run into a weird problem
> > with the 1.99.7 release, though - printing the dict yields the same on both
> > releases, but it's as if signal_autoconnect is behaving differently. If I
> > print 'self' as its passed to one of my callbacks now, I get:
> >
> > repr(self) = <bound method PlaylistWindow.update_current of <bound
> > method PlaylistWindow.on_jump_to_selected_activate of <bound method
> > PlaylistWindow.on_select_previous_activate of <bound method
> > PlaylistWindow.on_refresh_activate of <bound method
> > PlaylistWindow.on_cue_backward_activate of <bound method
> > PlaylistWindow.on_select_plus_ten_activate of <unbound method
> > Playlist.add_hook>>>>>>>
>
> Sure looks like a bug. And if it crashes python, it is one too. I would
> file a report on bugzilla.gnome.org. This is using glade1 but
> libglade2/pygtk2?
Yep. I was able to work around it by doing this instead:
for (k, v) in dict.items():
self.xml.signal_connect(k, v)
.. which will do for now. I check out the CVS version of pygtk, but
unfortunately ran into compilation problems and gave up. I should check that
again before submitting a bug report.
Thanks for the reply,
--
Damien Elmes
resolve@repose.cx