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


Groups > comp.lang.python > #56609 > unrolled thread

Re: How to make Tkinter Listbox entry insensitive?

Started byJason Swails <jason.swails@gmail.com>
First post2013-10-10 17:44 -0400
Last post2013-10-10 17:44 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#56609 — Re: How to make Tkinter Listbox entry insensitive?

FromJason Swails <jason.swails@gmail.com>
Date2013-10-10 17:44 -0400
SubjectRe: How to make Tkinter Listbox entry insensitive?
Message-ID<mailman.961.1381441480.18130.python-list@python.org>

[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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web