Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Rick Johnson Newsgroups: comp.lang.python Subject: Re: How to configure Tkinter Listbox to disable state keeping selected item highlighted Date: Wed, 18 Jul 2012 16:47:55 -0700 (PDT) Organization: http://groups.google.com Lines: 39 Message-ID: <19fa8023-baba-446f-93ae-08e99cdadf50@googlegroups.com> References: <92bf377d-05ea-42f8-98e4-3d76114aebc9@googlegroups.com> NNTP-Posting-Host: 166.249.202.115 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1342655275 874 127.0.0.1 (18 Jul 2012 23:47:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Jul 2012 23:47:55 +0000 (UTC) In-Reply-To: <92bf377d-05ea-42f8-98e4-3d76114aebc9@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=166.249.202.115; posting-account=h3aEwQoAAACiuqX-oR3gvCVFm8lLHoWj User-Agent: G2/1.0 X-Received-Bytes: 3403 Xref: csiph.com comp.lang.python:25593 On Tuesday, July 17, 2012 8:55:21 AM UTC-5, Sarbjit singh wrote: > I am having a problem configuring a listbox widget such that the selection remains highlighted even while it is set (programmatically) to the DISABLED state. Below code shows the problem: > > from Tkinter import * > master = Tk() > listbox = Listbox(master) > listbox.pack() > listbox.insert(END, "Text1") > listbox.insert(END, "Text2") > listbox.insert(END, "Text3") > listbox.selection_set(first=0, last=None) > listbox.configure(exportselection=False) > listbox.configure(state=DISABLED) > > Now when I change state to NORMAL, selected item is being highlighted. Is there a way I could disable widget (i.e. No response on mouse clicks) but keep the selected object remain highlighted? > > Intent: I want to utilise this widget on wizard App that I am creating. I would like this widget to indicate the current page / wizard number which the user selected. Is there any other widget I could use instead of it? (Labels possibly?) On Tuesday, July 17, 2012 8:55:21 AM UTC-5, Sarbjit singh wrote: > I am having a problem configuring a listbox widget such that the selection remains highlighted even while it is set (programmatically) to the DISABLED state. Below code shows the problem: > > from Tkinter import * > master = Tk() > listbox = Listbox(master) > listbox.pack() > listbox.insert(END, "Text1") > listbox.insert(END, "Text2") > listbox.insert(END, "Text3") > listbox.selection_set(first=0, last=None) > listbox.configure(exportselection=False) > listbox.configure(state=DISABLED) > > Now when I change state to NORMAL, selected item is being highlighted. Is there a way I could disable widget (i.e. No response on mouse clicks) but keep the selected object remain highlighted? > > Intent: I want to utilise this widget on wizard App that I am creating. I would like this widget to indicate the current page / wizard number which the user selected. Is there any other widget I could use instead of it? (Labels possibly?) What's wrong with a page number displayed on a label? Why must you insist on displaying every page number in a Listbox? That seems like a waste of resources to me. You could even say: "Showing page I of N".