Hi,

 I'm trying to implement an ATK object for a custom GTK widget, however
my ATK object factory class doesn't seem to actually get used. I've
boiled down what I'm doing to the following test code:

#!/usr/bin/env python
import atk, gtk


class CustomWidget(gtk.DrawingArea):

        def __init__(self):
                gtk.DrawingArea.__init__(self)
                print self.get_accessible()


class CustomWidgetATK(atk.GObjectAccessible, atk.Component):

        def __init__(self, obj):
                atk.GObjectAccessible.__init__(self)
                print "Custom ATK for", obj


class CustomWidgetATKFactory(atk.ObjectFactory):

        def __init__(self):
                atk.ObjectFactory.__init__(self)
                print "Factory initialised"

        def create_accessible(self, obj):
                print "Created accessible"
                return CustomWidgetATK(obj)

atk.get_default_registry().set_factory_type(CustomWidget,
        CustomWidgetATKFactory)


if __name__ == "__main__":
        c = CustomWidget()


 The self.get_accessible() call just returns None (and if the
CustomWidgetATKFactory isn't added to the ATK registry then it returns
the normal DrawingArea accessible object). Neither the create_accessible
method nor constructor for CustomWidgetATKFactory ever get called.

 Any advice on where I'm going wrong would be greatly appreciated.

Thanks,
 Mike.

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

Reply via email to