Ticket UUID: | a137728410ef1ea51bb8936655c60fa2fc2cc3ab | |||
Title: | linux: text widget failure with -yscrollcommand | |||
Type: | Bug | Version: | 8.6.9 | |
Submitter: | bll | Created on: | 2018-12-01 00:49:48 | |
Subsystem: | (unused) | Assigned To: | fvogel | |
Priority: | 3 Low | Severity: | Minor | |
Status: | Closed | Last Modified: | 2018-12-01 23:08:43 | |
Resolution: | Wont Fix | Closed By: | fvogel | |
Closed on: | 2018-12-01 23:08:43 | |||
Description: |
Linux (not tested on windows). Occurs in 8.6.6 also, so this must have been around a while. Since there is no guarantee of what order the widgets are created, the text widget should not yet be calling '.sb set'. Especially as no text has been inserted yet. The following command: text .t5 -yscrollcommand [list .sb set] causes a failure in 8.6.9: invalid command name ".sb" invalid command name ".sb" while executing ".sb set 0.0 0.07142857142857142" (vertical scrolling command executed by text) -- Edit: Windows 8.6.9 also. -- Edit 2: Does not occur in revised_text branch. | |||
User Comments: |
fvogel added on 2018-12-01 23:08:43:
> Is revised_text getting into 8.7? It will be merged when TIP #466 will be accepted. Note that the revised text widget also triggers the error when it is packed: package require Tk pack [text .t -yscrollcommand [list .sb set]] ; # error bll added on 2018-12-01 15:01:24: Changed status. Only an issue with interactive use then. Is revised_text getting into 8.7? fvogel added on 2018-12-01 10:57:49: This has been present since the beginning of time I think and never bothered me much. The order of creation of the widgets is not important as long as there is no "update" round in-between. Of course this applies to scripts. For interactive use of Tk the error triggers, but there is no further consequences: when the scrollbar is later defined it works as expected. For instance, copy/pasting the following script in tclsh will trigger the error but it won't trigger when that same script is sourced because the update round happens at the end of the sourcing: package require Tk text .t -yscrollcommand [list .sb set] scrollbar .sb -command [list .t yview] pack .t .sb If an "update" is added between the text widget declaration and the scrollabr declaration, then the error will trigger also when sourcing the script. I don't really think this is a problem in fact. Yes, the revised_text widget does not exhibit the same behavior, and this provides more comfort during interactive testing. Note that the error also triggers if the text widget is replaced by a canvas in the script above. We could refine the legacy widget behavior and the canvas as well, but honestly I think we have more pressing tickets to address. marc_culler (claiming to be Marc Culler) added on 2018-12-01 02:48:10: I get the same error message (no crash) with 8.6.9 on mojave, using check-in [5944d2a3] which is the tip of the bugfix branch bug-12f7fe1f23. bll added on 2018-12-01 01:24:04: Apparently this only happens in certain circumstances (though I don't know what those are). I have code in my application where the text widget is set up before the scrollbar and I don't get this error. |
