This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Arif.Zaman
Recipients Arif.Zaman
Date 2011-03-19.20:37:56
SpamBayes Score 2.6048572e-06
Marked as misclassified No
Message-id <1300567077.69.0.560043007986.issue11611@psf.upfronthosting.co.za>
In-reply-to
Content
In the wxPython Demo the PropertyGrid code has the lines

        #
        # Let's use some simple custom editor
        #
        # NOTE: Editor must be registered *before* adding a property that
        # uses it.
            pg.RegisterEditor(TrivialPropertyEditor)
            pg.RegisterEditor(SampleMultiButtonEditor)
            pg.RegisterEditor(LargeImageEditor)

The first time you look at this demo, it runs. Then if you go to some other demo, and return back to this (in the same session), it tries to register the same editors. Since they are already registered this causes an AssertionError. I fixed it by

        #
        # Let's use some simple custom editor
        #
        # NOTE: Editor must be registered *before* adding a property that
        # uses it.
        try:
            pg.RegisterEditor(TrivialPropertyEditor)
            pg.RegisterEditor(SampleMultiButtonEditor)
            pg.RegisterEditor(LargeImageEditor)
        except AssertionError:
            pass

although I am sure you can probably do better.

PS: This is my first visit to this site, so if I have posted this with some incorrect area, please just let me know kindly.
History
Date User Action Args
2011-03-19 20:37:57Arif.Zamansetrecipients: + Arif.Zaman
2011-03-19 20:37:57Arif.Zamansetmessageid: <1300567077.69.0.560043007986.issue11611@psf.upfronthosting.co.za>
2011-03-19 20:37:56Arif.Zamanlinkissue11611 messages
2011-03-19 20:37:56Arif.Zamancreate