Go Back   AC3D Forums > Resources > AC3D Scripts and Mods
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 5th August 2012, 02:11 PM   #1
thorax
Junior Member
Member
 
Join Date: Nov 2011
Posts: 10
Default Disable tk_messageBox using global variable

Hi, im doing some batch script conversion using TCL
Im getting these annoying tk_messageBox that completely stop my process.

Code:
sending command to TCL: set tkms [tk_messageBox -title "AC3D message" -message "Warning: 1356 objects did not have textures assigned.  You must assign a texture to every object for X-Plane output." -type ok -icon info -parent . ]
I've seen that for instance
Code:
set_unsaved_changes 0
disables unsaved changes popups.

Is there any similar global variable or set proc to disable these tk_messageBox as well?
these look like standard TCL and i cant modify the plugin that is calling them cause i dont have the source code.

ive looked into various TCL files and using ac3d list but found no similar proc.

thanks a lot.
thorax is offline   Reply With Quote
Old 9th August 2012, 06:13 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Disable tk_messageBox using global variable

Have you tried redfining tk_messageBox as new proc? Might work.
Andy is offline   Reply With Quote
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
Old 15th October 2013, 10:46 AM   #4
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Default Re: Disable tk_messageBox using global variable

Opps one minor error - add

rename tk_messageBox {}

before

rename tk_messageOriginal tk_messageBox

otherwise the proc "tk_messageBox" already exists and cannot be overwritten. Renaming tk_messageBox to {} (the empty string) destroys its (temporary) version.
Geoffm is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 10:14 PM.


AC3D Forum
(C) Inivis Limited 2020