From: SourceForge.net <no...@so...> - 2010-05-27 19:23:06
|
Bugs item #3006842, was opened at 2010-05-25 05:48 Message generated for change (Comment added) made by jenglish You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3006842&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 88. Themed Tk Group: current: 8.5.8 Status: Open Resolution: None Priority: 7 Private: No Submitted By: Steven (stevenaaus) Assigned to: Joe English (jenglish) >Summary: Empty tag bindings crash ttk::treeview Initial Comment: This may be a very minor windows only bug, but activestate tcl-8.5.8.2 (WinXP) crashes immediately when i assign a null binding to button-1 on a treeview widget, and click on the widget. The code that causes it is $w.tree tag bind click1 <Button-1> {} When using click1 as a tag such as $w.tree insert {} 0 -values $values -tag [list click1 click2 treefont] Problem is easily solved by removing null binding. Sorry for such a shitty bug report, but it may be interesting to someone Project is scidvspc , subversion release 42 http://scidvspc.svn.sourceforge.net/viewvc/scidvspc?view=rev&revision=42 ---------------------------------------------------------------------- >Comment By: Joe English (jenglish) Date: 2010-05-27 12:23 Message: Apparently Tk_BindEvent() does not like it if an empty script is passed to Tk_CreateBinding(). This is the apparent cause of the coredump. Other widgets (text, canvas) interpret [$w tag foo <...> {}] to mean "remove this tag binding entirely"; ttk::treeview widget updated to do the same. Additionally: the [text] and [canvas] widgets can be made to crash by appending an empty script to a binding: pack [text .t] .t tag bind empty <ButtonPress-1> + .t insert end "CLICK ME" empty ---------------------------------------------------------------------- Comment By: Steven (stevenaaus) Date: 2010-05-25 15:47 Message: I had a go at reproducing it with the 8.5 tk demo " 4. A multi-column list of countries" and it is easily reproducible here. To make the demo crash make these changes. + $w.tree tag bind click1 <Button-1> {} foreach {country capital currency} $data { - $w.tree insert {} end -values [list $country $capital $currency] + $w.tree insert {} end -values [list $country $capital $currency] -tag click1 and click on treeview. Using + $w.tree tag bind click1 <Button-1> {puts ok} is fine. ----------------------------------------- [ Can anyone tell me how to figure out how many ttk_treeview rows are in a widget after it has been resized. I think i saw that "treeview configure -rowheight" is in cvs... but is there another way I currently use: set fontspace [font metrics [ttk::style lookup [$w cget -style] -font] -linespace] set fontspace [expr $fontspace*120/72] ; # hack to make it work better set num_rows [expr {int( [winfo height $w] / $fontspace)}] ] ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2010-05-25 09:55 Message: Nope, I haven't seen this before, and it hasn't been fixed. The treeview widget is apparently not using Tk_BindEvent() et. al., in the way in which they were designed to be used. More than that I cannot say at this time; will look into it later. Thanks for the bug report, it's actually quite useful. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2010-05-25 09:41 Message: I think I've seen this before. I thought it was fixed. Will check. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3006842&group_id=12997 |