homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: wm_attributes doesn't take keyword arguments
Type: enhancement Stage: test needed
Components: Tkinter Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: loewis Nosy List: asvetlov, gpolo, gregcouch, klappnase, loewis
Priority: normal Keywords: patch

Created on 2006年06月05日 06:35 by gregcouch, last changed 2022年04月11日 14:56 by admin.

Files
File name Uploaded Description Edit
Tkinter.patch gregcouch, 2006年06月05日 06:35 wm_attributes patch
issue1500773.diff gpolo, 2008年06月07日 22:21 review
Messages (4)
msg50427 - (view) Author: Greg Couch (gregcouch) Date: 2006年06月05日 06:35
The Tk wm attributes command takes option arguments
(from the Tk wm manual page):
 wm attributes window ?option value option value...?
And option arguments are normally given with keyword
arguments in Tkinter (most if not all widget creation
functions and widget commands). The attached patch
changes the wm_attributes method to take keyword
arguments, so top.wm_attributes(alpha=.8) will work as
expected (on Windows XP and Mac OS X).
msg50428 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006年06月17日 09:30
Logged In: YES 
user_id=21627
This is an incompatible change. I also don't see the point;
top.wm_attributes('alpha',.8)
should work just fine, no?
msg50429 - (view) Author: klappnase (klappnase) * Date: 2006年07月20日 10:43
Logged In: YES 
user_id=797929
I do not have winXP or OSX available to actually test it,
but I doubt that
 top.wm_attributes('alpha',.8)
will work; from Tk documentation it looks like you will have
to write
 top.wm_attributes('-alpha',.8)
which is in fact not what one would expect.
Maybe a better solution than Greg's patch was to change
wm_attributes() to accept both ways, like:
def wm_attributes(self, *args, **kw):
 args = ('wm', 'attributes', self._w) + args +
self._options({}, kw)
 return self.tk.call(args)
so that old code will not break and the more intuitive
version that Greg suggested is also legal.
msg67668 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008年06月03日 18:21
I'm adding my own version, this was done against python-trunk
History
Date User Action Args
2022年04月11日 14:56:17adminsetgithub: 43457
2012年03月21日 19:45:52asvetlovsetnosy: + asvetlov
2010年08月09日 03:27:04terry.reedysetversions: + Python 3.2, - Python 3.1, Python 2.7
2009年03月21日 03:39:03ajaksu2setstage: test needed
type: enhancement
versions: + Python 3.1, Python 2.7, - Python 2.5
2008年06月07日 22:21:02gpolosetfiles: + issue1500773.diff
2008年06月07日 22:20:38gpolosetfiles: - issue1500773.diff
2008年06月03日 18:21:51gpolosetfiles: + issue1500773.diff
nosy: + gpolo
messages: + msg67668
2006年06月05日 06:35:26gregcouchcreate

AltStyle によって変換されたページ (->オリジナル) /