[Patches] [ python-Patches-612602 ] "Bare" text tag_configure in Tkinter
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 21 Sep 2002 13:35:40 -0700
Patches item #612602, was opened at 2002-09-21 20:50
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=612602&group_id=5470
Category: Tkinter
Group: Python 2.1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Reeves (sreeves)
Assigned to: Nobody/Anonymous (nobody)
>Summary: "Bare" text tag_configure in Tkinter
Initial Comment:
In Tcl/Tk, doing a "tag configure" operation on a text
widget with only a tag name as argument returns all of
the attributes configured for that tag. The analogous
tag_configure method in Tkinter returns nothing.
The attached patch fixes this.
I'm using Python 2.1, but the same bug is in 2.2 as
well. Here is a typescript showing the results of the
analogous commands in Tcl/Tk and Tkinter:
$ wish
% text .t
.t
% .t tag configure someTag -foreground red
% .t tag configure someTag -foreground
-foreground {} {} {} red
% .t tag configure someTag
{-background {} {} {} {}} {-bgstipple {} {} {} {}}
{-borderwidth {} {} 0 {}} {-elide {} {} 0 {}}
{-fgstipple {} {} {} {}} {-font {} {} {} {}}
{-foreground {} {} {} red} {-justify {} {} {} {}}
{-lmargin1 {} {} {} {}} {-lmargin2 {} {} {} {}}
{-offset {} {} {} {}} {-overstrike {} {} {} {}}
{-relief {} {} {} {}} {-rmargin {} {} {} {}} {-spacing1
{} {} {} {}} {-spacing2 {} {} {} {}} {-spacing3 {} {}
{} {}} {-tabs {} {} {} {}} {-underline {} {} {} {}}
{-wrap {} {} {} {}}
% ^D
$ python
Python 2.1.3 (#1, Sep 7 2002, 15:29:56)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more
information.
>>> import Tkinter
>>> root = Tkinter.Tk()
>>> t = Tkinter.Text(root)
>>> t.tag_configure('someTag', foreground='red')
>>> t.tag_configure('someTag', 'foreground')
('foreground', '', '', '', 'red')
>>> t.tag_configure('someTag')
>>> ^D
$
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-09-21 22:35
Message:
Logged In: YES
user_id=21627
I may be missing something, but shouldn't tag_configure
return a dictionary in this case? See the widget's configure
for comparison.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=612602&group_id=5470