Richard Fish <[EMAIL PROTECTED]> writes:

> Sam Tannous wrote:
> > So what am I supposed to do now?
> 
> Use class attributes referenced from self, or lambda's to pass the
> class instance to your callbacks:
[...]

There is a third solution, kindly provided by Gtk:

def clicked_cb (junk, button):
  print button.my_attr

button = GtkButton(...)
button.my_attr = "something"
... blah blah ...
button.connect ("clicked", clicked_cb, button)

I've used this kind of code with success.  If all you wish to do is
embed something in an existing class, then my proposal is less
heavy-weight than inheriting from GtkButton and nicer than the lambda
hack.

If our 1:1 mapping ideas see the light of day, you should be able to
simply use the "junk" argument directly.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to