[Patches] [ python-Patches-457713 ] Allow "itemconfigure" for Listboxes.

noreply@sourceforge.net noreply@sourceforge.net
Sun, 02 Sep 2001 15:15:47 -0700


Patches item #457713, was opened at 2001-09-02 03:20
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=457713&group_id=5470

Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Joseph A Knapka (jknapka)
Assigned to: Guido van Rossum (gvanrossum)
>Summary: Allow "itemconfigure" for Listboxes.

Initial Comment:
This patch allows foreground and background
colors to be configured for individual items
in a Listbox. The "itemconfigure" and "itemcget"
code from Canvas is pulled out into a new mixin
class which is inherited by Canvas and Listbox.
It seems to "just work", unless I am neglecting
some subtle aspect of Tkinter code. The patch
is against the Python 2.1.1 Tkinter.py file.

(Note: this patch addresses #426880, for which
someone neglected to provide code. I am
not, incidentally, the individual who submitted
the earlier patch :-)


----------------------------------------------------------------------

>Comment By: Joseph A Knapka (jknapka)
Date: 2001-09-02 15:15

Message:
Logged In: YES 
user_id=118570

Well, in that case the easy thing would be to
just copy the definition of the "itemcget"
method out of Canvas and paste it into Listbox.
Hardly worth producing a patch file for that. 
I think it is desirable to have both itemconfig
and itemcget, because not doing so violates
the expectations of those familiar with Tk.
It's a small detail, but attention to detail
is what makes Python great, right? (OK, among
other things :-)


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-02 14:24

Message:
Logged In: YES 
user_id=6380

No, I just meant that I hate doing double work myself, and
unless your patch provides something extra, I'm reluctant to
put more effort in. Given the sheer size of Tkinter.py, one
little bit of code sharing doesn't make much of a
difference.

----------------------------------------------------------------------

Comment By: Joseph A Knapka (jknapka)
Date: 2001-09-02 09:25

Message:
Logged In: YES 
user_id=118570

Err... are you saying you'd prefer to have the
item configuration code duplicated in Canvas
and Listbox? The only difference
between this patch and the bug 457487 one is
that that one uses cut+paste, and this one
uses inheritance.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-02 06:48

Message:
Logged In: YES 
user_id=6380

Hm, I just checked in yet another contributed patch that
added Listbox.itemconfigure, but without refactoring and
without itemcget. Would you mind integrating that into your
patch?
See bug #457487.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=457713&group_id=5470