home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / tcl / 2143 < prev    next >
Encoding:
Text File  |  1992-12-20  |  2.1 KB  |  58 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!mcsun!dxcern!dxcern.cern.ch!trones
  3. From: trones@dxcern.cern.ch (Jostein Lodve Trones)
  4. Subject: Changing a menuitem while selected
  5. Message-ID: <1992Dec18.091959.16241@dxcern.cern.ch>
  6. Sender: news@dxcern.cern.ch (USENET News System)
  7. Reply-To: trones@dxcern.cern.ch (Jostein Lodve Trones)
  8. Organization: CERN, European Laboratory for Particle Physics, Geneva
  9. Date: Fri, 18 Dec 1992 09:19:59 GMT
  10. Lines: 46
  11.  
  12.  
  13.  
  14. I have this program where I invoke different procedures by selecting from
  15. a menu. But sometimes I get an error, and it does not seem to be deterministic,
  16. ie I am not able to reproduce the error, but it happens every now and then.
  17.  
  18. The error is
  19. invalid command name : "83" <-- This is sometimes different, for instance
  20.                                 "ms" or other times a whole word taken from
  21.                                 one of my comment lines in the program...
  22.   while executing
  23. "error "invalid command name: \"$cmdName\""
  24.      (procedure "unknown" line 32)
  25.       invoked from within
  26. "83"
  27.        invoked from within
  28. "$menu invoke $i"
  29.        ("then" clause line 4)
  30.        invoked from within
  31. "if {$i != "none"} {
  32.              tk_mbUnpost
  33.              update idletasks
  34.              $menu invoke $i
  35.     }"
  36.        (procedure "tk_invokeMenu" line 3)
  37.     invoked from within
  38. "tk_invokeMenu .TAPE_SERVERS.menu:c"    <---- This is just the name of the menu
  39.         (command bound to event)
  40.  
  41. I am aware that the error may be difficult to find without having the source
  42. code, (and that is quite long) so I will just ask two questions:
  43.  
  44. (1) The menu is named in the format .$window_name.menu:$menu_button_name
  45.     Can a ':' in the name cause any problems?
  46.  
  47. (2) When a selection is made, let's say we select menuitem no 2, the invoked
  48.     procedure will change the command bound to this menuitem, using
  49.     ".$window_name.menu:$menu_button_name entryconfigure 2 -command ....."
  50.     So I am actually changing the command bound to the event while I am
  51.     executing the command that was earlier bound to the event.
  52.     Can this cause the problem?
  53.  
  54. Thank's for any and all replies.
  55.  
  56. Cheers,
  57.     Jostein
  58.