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.

classification
Title: wxPython PropertyGrid Demo error and fix
Type: Stage: resolved
Components: Demos and Tools Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Arif.Zaman, ned.deily
Priority: normal Keywords:

Created on 2011-03-19 20:37 by Arif.Zaman, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unnamed Arif.Zaman, 2011-03-20 05:24
Messages (3)
msg131441 - (view) Author: Arif Zaman (Arif.Zaman) Date: 2011-03-19 20:37
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.
msg131445 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-03-19 21:35
What demo file are you referring to?  If it is something to do with wxPython, you probably want to refer to the bug tracker for that project.  wxPython is not part of the standard Python library.

See http://www.wxpython.org/ and http://trac.wxwidgets.org/
msg131478 - (view) Author: Arif Zaman (Arif.Zaman) Date: 2011-03-20 05:24
Thanks, will do.

Arif

On Sun, Mar 20, 2011 at 2:35 AM, Ned Deily <report@bugs.python.org> wrote:

>
> Ned Deily <nad@acm.org> added the comment:
>
> What demo file are you referring to?  If it is something to do with
> wxPython, you probably want to refer to the bug tracker for that project.
>  wxPython is not part of the standard Python library.
>
> See http://www.wxpython.org/ and http://trac.wxwidgets.org/
>
> ----------
> nosy: +ned.deily
> status: open -> pending
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue11611>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55820
2011-03-20 05:28:30ned.deilysetstatus: open -> closed
nosy: ned.deily, Arif.Zaman
type: compile error ->
resolution: not a bug
stage: resolved
2011-03-20 05:24:35Arif.Zamansetfiles: + unnamed
status: pending -> open

messages: + msg131478
nosy: ned.deily, Arif.Zaman
2011-03-19 21:35:26ned.deilysetstatus: open -> pending
nosy: + ned.deily
messages: + msg131445

2011-03-19 20:37:56Arif.Zamancreate