klappnase added the comment:

Hi Miguel,
about _configure() :
the code you suggest:

    def _configure(self, cmd, cnf, kw):
        """Internal function."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        elif cnf:
            cnf = _cnfmerge(cnf)
        if cnf is None:
            return self._getconfigure(cmd)
        if isinstance(cnf, str):
            return self._getconfigure1(cmd + ('-'+cnf,))
        self.tk.call(cmd + self._options(cnf))

will break all other methods that use configure() and friends. A possible way 
to work around this might be:

    def _configure(self, cmd, cnf, kw):
        """Internal function."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        elif cnf:
            cnf = _cnfmerge(cnf)
        if not self._w in cmd:
            cmd = _flatten((self._w, cmd))
        if cnf is None:
            return self._getconfigure(cmd)
        if isinstance(cnf, str):
            return self._getconfigure1(cmd + ('-'+cnf,))
        self.tk.call(cmd + self._options(cnf))

Not sure if this is smart, though, it might require some thorough testing.

About getboolean() :

it seems like tkapp.getboolean() returns 1 or 0 when it is passed an integer 
value, at least this is still true here for Python-3.4.2:

$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tkinter import *
>>> r=Tk()
>>> getboolean(1)
1
>>> getboolean('1')
True
>>> getboolean('yes')
True
>>> getboolean(True)
True
>>> 


Probably the best thing to do would be to fix this in the C code. The next best 
thing I think is to change tkinter.getboolean(), tkinter.Misc.getboolean() and 
tkinter.Misc._getboolean(). This however leaves a number of Tkinter methods 
like e.g. Text.compare() which directly use self.tk.getboolean() unresolved.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to