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 louielu
Recipients Frank Pae, louielu, serhiy.storchaka, terry.reedy
Date 2017-04-29.06:56:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493448975.33.0.634105123616.issue30200@psf.upfronthosting.co.za>
In-reply-to
Content
The problem cause by listbox.curselection(). When crossing from a listbox to another listbox, it will trigger twice event.

The first time get a valid select tuple from curselection() (which will return (index, label)), and the second time will generate empty tuple.

You should check curselection()'s tuple before passing into listbox.get(). The easiest is to add a if stmt for lb_*_cur, for example:


def get_style(event):
        # self.style.set(listbox_style.get(listbox_style.curselection()))
        # ____TEST____ >
        lb_sty_cur = listbox_style.curselection()
        if lb_sty_cur:
            lb_sty_get = listbox_style.get(lb_sty_cur)
            self.style.set(lb_sty_get)
        return
History
Date User Action Args
2017-04-29 06:56:15louielusetrecipients: + louielu, terry.reedy, serhiy.storchaka, Frank Pae
2017-04-29 06:56:15louielusetmessageid: <1493448975.33.0.634105123616.issue30200@psf.upfronthosting.co.za>
2017-04-29 06:56:15louielulinkissue30200 messages
2017-04-29 06:56:14louielucreate