From: <no...@so...> - 2002-10-02 22:15:41
|
Bugs item #612110, was opened at 2002-09-20 06:21 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=612110&group_id=12997 Category: 01. Bindings Group: 8.4.0 Status: Open Resolution: None Priority: 5 Submitted By: Michael Schlenker (mic42) Assigned to: Jeffrey Hobbs (hobbs) Summary: Crash on FocusIn / FocusOut binding Initial Comment: Jakub Travnik wrote: > Jakub Travnik wrote: >> P.S.: searching ruby-talk archive show that this bug has been noticed >> before but with no attempt to correct it. But since python can do it >> and ruby tcl/tk is modeled after python's so it should be fixable. >> > > Hello, > > I have solved the problem. Bug is in the Tk itself, see following > tcltk code: > ----cut_here------------------- > entry .e1 -width 10 > entry .e2 -width 10 > label .l1 -text "initial" > pack .e1 -side left > pack .e2 -side left > pack .l1 -side left > bind .e1 <FocusIn> {.l1 configure -text %S} > bind .e1 <FocusOut> {.l1 configure -text %S} > ------------------------------- > > This will crash in Tk_GetHWND called from TkpPrintWindowId > called from case "%S" in ExpandPercents when FocusIn/FocusOut event > happen. > <snip> > > Long term fix is to remove %S from tk.rb file depending on event, or > fix tcl/tk windows version to behave in correct way for this situation. > I can confirm the crash with tcl/tk 8.4.0 from cvs. Windows 2000. Michael Schlenker callstack dump: Tk_GetHWND(unsigned long 3) line 147 + 3 bytes TkpPrintWindowId(char * 0x0012f800, unsigned long 3) line 174 + 15 bytes ExpandPercents(TkWindow * 0x00a23cc8, const char * 0x00a1f06c, _XEvent * 0x00a7f798, unsigned long 0, Tcl_DString * 0x0012faa4) line 2576 + 19 bytes Tk_BindEvent(Tk_BindingTable_ * 0x008c4448, _XEvent * 0x00a7f798, Tk_Window_ * 0x00a23cc8, int 4, void * * 0x0012fbc0) line 1670 + 40 bytes TkBindEventProc(TkWindow * 0x00a23cc8, _XEvent * 0x00a7f798) line 288 + 31 bytes Tk_HandleEvent(_XEvent * 0x00a7f798) line 1017 + 13 bytes WindowEventProc(Tcl_Event * 0x00a7f790, int -3) line 1399 + 12 bytes Tcl_ServiceEvent(int -3) line 622 + 11 bytes Tcl_DoOneEvent(int -3) line 861 + 9 bytes Tk_MainLoop() line 1457 + 13 bytes Tk_MainEx(int 1, char * * 0x008626c8, int (Tcl_Interp *)* 0x00401005 _Tcl_AppInit, Tcl_Interp * 0x00864790) line 285 WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x0013285d, int 10) line 140 + 26 bytes WinMainCRTStartup() line 330 + 54 bytes KERNEL32! 77e7d326() ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2002-10-02 15:15 Message: Logged In: YES user_id=72656 Confirmed - it seems that %S is output without a real check for whether it is valid in tkBind.c:ExpandPercents. entry .e1; entry .e2 label .l1 -text "initial" pack .e1 .e2 .l1 -side left bind .e1 <FocusIn> {.l1 configure -text %S} bind .e1 <FocusOut> {.l1 configure -text %S} ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=612110&group_id=12997 |