View Single Post
Old 26th September 2013, 07:29 AM   #3
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Default Re: Disable tk_messageBox using global variable

Inserting this into a tcl script file (in /programs/ac3dxxx/scripts) will disable messageBoxes entirely.

proc tk_messageBox {args} { return "no" }

The disadvantage is that all messageBoxes will return no; this may affect any command which calls tk_messageBox. you may prefer to return "yes" of course.

You should ensure that the replacement tk_messageBox is only installed when you don't want messages. One way is:

rename tk_messageBox tk_messageOriginal
proc tk_messageBox {args} { return "no" }
#
# ... do all your scripted operations which used to annoy with messageBoxes
#
rename tk_messageOriginal tk_messageBox

The final line will reinstate standard tk_messageBox behaviour.
Geoffm is offline   Reply With Quote