New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tix HList header_exists should be "exist" #69650
Comments
The method header_exists of Tix HList raises: File "...\python3\lib\tkinter\tix.py", line 926, in header_exists IOW the option should be "exist" not "exists". I've seen this on Windows with python 2.7 and 3.4 and Linux-Mint with 2.7.6. The current method "header_exists" doesn't seem to be referenced or documented anywhere. |
(Rob: FYI, a crash is something worse than just an exception.) I know very little about tix, so I don't know whether the bug is really passing 'exists' or that not being accepted. I think it is the latter. The offending function in class HList is def header_exists(self, col):
return self.tk.call(self._w, 'header', 'exists', col) There are also def indicator_exists(self, entry):
return self.tk.call (self._w, 'indicator', 'exists', entry)
def info_exists(self, entry):
return self.tk.call(self._w, 'info', 'exists', entry)
def item_exists(self, entry, col):
return self.tk.call(self._w, 'item', 'exists', entry, col) This pattern, and the more general pattern def x_y(arg1, ...):
return self.tk.call(self._w, 'x', 'y', arg1, ...) suggests that header_exists is written correctly and that 'exists' is not the error. The other accepted options, cget, configure, create, delete, and size are other options for y when x is 'header'. I don't know what an 'entry' must be, but this runs without error.
>>> root = tix.Tk()
>>> hl = tix.HList(root)
>>> hl.info_exists('')
'0' http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm#M73 Still, it is possible that the attached patch is the best we can do, but then, if I am correct, a comment should be added that it is a bug workaround. A test is really needed, but test_tix, added in 3.5, is vestigial and only tests that tix.Tk() works on Windows. Adding real tests would be a separate issue. Serhiy, is this something that might be done or is tix considered passe'? |
It looks as a bug in Tix. All other Tcl, Tk and Tix commands (except "assemblecode") use "exists", and "header exists" is documented. Perhaps we should workaround this bug. But I doubt about renaming header_exists to header_exist. As for tests, I'm working on writing tests for Tix. The progress is slow because Tix provides a lot of classes with a lot of commands and options, but I hope to finish the work before releasing 3.6. We can commit the patch for this issue without tests, just add a reminder in test_tix.py. |
I agree. Leave the name 'header_exists', consistent with all others, pass 'exist', and add a comment. Optional: report the bug upstream if there are tix maintainers somewhere. Serhiy, my question about the status of tix is really whether I can use it in IDLE, since it is not now. |
I can't say anything. But be aware that Tix is optional and likely is not installed on Linux. Maintainers should add new dependence to IDLE package in every distribution. |
If tkinter and IDLE are some places installed without tix, then it it not usable. What about the suggestion for a revised patch? |
Opened Tix bug: https://sourceforge.net/p/tix/bugs/110/ . |
As for using Tix in IDLE, on Python wiki [1] there is a mention about the 'Tixed' version of IDLE called IDEStudio: [2], [3]. [1] https://wiki.python.org/moin/Tix |
New changeset f57078cf5f13 by Serhiy Storchaka in branch '2.7': New changeset e928afbcc18a by Serhiy Storchaka in branch '3.5': New changeset 523aecdb8d5f by Serhiy Storchaka in branch '3.6': New changeset 5b33829badcc by Serhiy Storchaka in branch 'default': |
It is hard to add tests because testing infrastructure for Tix doesn't exist. |
Subsequent to me suggesting a test, the 3.6 doc gained this: "Deprecated since version 3.6: This Tk extension is unmaintained and should not be used in new code." This answers my question about using it in IDLE. Good to apply this anyway, but no test is fine with me. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: