Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56609

Re: How to make Tkinter Listbox entry insensitive?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jason.swails@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'true,': 0.05; 'tkinter': 0.07; 'to:addr:pobox.com': 0.09; 'to:addr:skip': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'listbox': 0.16; 'subclass': 0.16; 'subclassing': 0.16; 'subject:Tkinter': 0.16; 'subject:insensitive': 0.16; 'subject:make': 0.16; 'flexibility': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'written': 0.21; 'seems': 0.21; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'entries': 0.24; 'skip': 0.24; 'fairly': 0.24; "i've": 0.25; '&gt;': 0.26; 'references': 0.26; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'embed': 0.31; 'own,': 0.31; 'allows': 0.31; 'handled': 0.32; 'trouble': 0.34; 'could': 0.34; 'point.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'entry': 0.36; 'subject:?': 0.36; 'should': 0.36; 'area': 0.37; 'implement': 0.38; 'actions': 0.38; 'jason': 0.38; 'pm,': 0.38; 'either': 0.39; 'removing': 0.60; 'back': 0.62; 'maximum': 0.63; 'become': 0.64; 'within': 0.65; 'capable': 0.67; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Suqj5fdSoFHsVVCq2nqmaydE7d8hqDSa/qmVjmA2ZMY=; b=VdpNLFRG4P5Ye9jAcc9mIF3T0FKZcEWIXCAAaHjM7GRO77pq5bFJfbmMH9/NKQKgFM O8Y1mZcwTSetQgddwpfEDfRfn5BU0aaqnXX2MVwnaKtPr+dfqJG0Sa0ZzXGFaV7+DHYR CfSLTcFa/HyJ45caoOoESR63YKYVvt4/CVaqvQF2T2fjJsnXIE8NJ6cGYBeNealbzZ5L K8iCTAFi+83RpydckNcTK2giO2VtJad4Uc0+OPYFT6nLZqa6K7EulAxrcYBElmzNyKq2 RULp3ToT1sDSjpfX1jsVoVJxxr4V8wrVJPmBTE3jmUzQjSjXzLeeXlgaE0H10379NTyh PIKw==
MIME-Version 1.0
X-Received by 10.50.164.165 with SMTP id yr5mr303140igb.38.1381441471822; Thu, 10 Oct 2013 14:44:31 -0700 (PDT)
In-Reply-To <CANc-5Ux6V4u-JUz0M4ntOPSXm+t3yEB_dOmOL50NZbGeXr=DDg@mail.gmail.com>
References <CANc-5UxAau6djZ+zYQ+8a=3nPGHx_aDEUUtCVAcwOtq2fz4ZHw@mail.gmail.com> <CAPTjJmpmaa8JWE7VRA49tZKKrdkPSfGDVGOC9108ZobBeHJmMQ@mail.gmail.com> <CANc-5UyuKi-cAzCR6b2p81JggR557xjRTSwmG4xRmCBX9cbNYQ@mail.gmail.com> <CAMw+j7+pfnkjfj+vCUuCXLWnJHaA8n4n3Vrb5b+depXOjaMwAQ@mail.gmail.com> <CANc-5Ux6V4u-JUz0M4ntOPSXm+t3yEB_dOmOL50NZbGeXr=DDg@mail.gmail.com>
Date Thu, 10 Oct 2013 17:44:31 -0400
Subject Re: How to make Tkinter Listbox entry insensitive?
From Jason Swails <jason.swails@gmail.com>
To Skip Montanaro <skip@pobox.com>
Content-Type multipart/alternative; boundary=089e01229ed434c5df04e869e8bd
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.961.1381441480.18130.python-list@python.org> (permalink)
Lines 59
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381441480 news.xs4all.nl 15955 [2001:888:2000:d::a6]:49853
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56609

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Oct 10, 2013 at 2:29 PM, Skip Montanaro <skip@pobox.com> wrote:

> > Removing inappropriate entries is not much of a hack.
>
> True, but then I have to go through the trouble of adding them back in
> should they become valid again. :-)
>

It seems that this could be handled fairly straight-forwardly by
subclassing either Listbox or Frame to implement your own, custom widget.
 The trick is to retain references to every entry within the widget, but
only embed it in the viewable area if it happens to be a valid entry at
that point.  Then all that's left is to hook events up to the proper
callbacks that implement various actions of your custom widgets using what
Tkinter is capable of doing.

Personally I prefer to subclass Frame since it allows me the maximum
flexibility (I think 90+% of the widgets I've written for my own
Tkinter-based programs do this).

All the best,
Jason

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to make Tkinter Listbox entry insensitive? Jason Swails <jason.swails@gmail.com> - 2013-10-10 17:44 -0400

csiph-web