From: Michael Schlenker Date: 2002-09-17T01:31:24+09:00 Subject: Re: [BUG] in win32 tcltk/ruby FocusIn/FocusOut events 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 {.l1 configure -text %S} > bind .e1 {.l1 configure -text %S} > ------------------------------- > > This will crash in Tk_GetHWND called from TkpPrintWindowId > called from case "%S" in ExpandPercents when FocusIn/FocusOut event > happen. > > > 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. > Have you filed a bug report at sourceforge.net? http://sourceforge.net/projects/tktoolkit 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()