home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!mcsun!dxcern!dxcern.cern.ch!trones
- From: trones@dxcern.cern.ch (Jostein Lodve Trones)
- Subject: Changing a menuitem while selected
- Message-ID: <1992Dec18.091959.16241@dxcern.cern.ch>
- Sender: news@dxcern.cern.ch (USENET News System)
- Reply-To: trones@dxcern.cern.ch (Jostein Lodve Trones)
- Organization: CERN, European Laboratory for Particle Physics, Geneva
- Date: Fri, 18 Dec 1992 09:19:59 GMT
- Lines: 46
-
-
-
- I have this program where I invoke different procedures by selecting from
- a menu. But sometimes I get an error, and it does not seem to be deterministic,
- ie I am not able to reproduce the error, but it happens every now and then.
-
- The error is
- invalid command name : "83" <-- This is sometimes different, for instance
- "ms" or other times a whole word taken from
- one of my comment lines in the program...
- while executing
- "error "invalid command name: \"$cmdName\""
- (procedure "unknown" line 32)
- invoked from within
- "83"
- invoked from within
- "$menu invoke $i"
- ("then" clause line 4)
- invoked from within
- "if {$i != "none"} {
- tk_mbUnpost
- update idletasks
- $menu invoke $i
- }"
- (procedure "tk_invokeMenu" line 3)
- invoked from within
- "tk_invokeMenu .TAPE_SERVERS.menu:c" <---- This is just the name of the menu
- (command bound to event)
-
- I am aware that the error may be difficult to find without having the source
- code, (and that is quite long) so I will just ask two questions:
-
- (1) The menu is named in the format .$window_name.menu:$menu_button_name
- Can a ':' in the name cause any problems?
-
- (2) When a selection is made, let's say we select menuitem no 2, the invoked
- procedure will change the command bound to this menuitem, using
- ".$window_name.menu:$menu_button_name entryconfigure 2 -command ....."
- So I am actually changing the command bound to the event while I am
- executing the command that was earlier bound to the event.
- Can this cause the problem?
-
- Thank's for any and all replies.
-
- Cheers,
- Jostein
-