Message 1 of 2

Not applicable
12-21-2018
07:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on a tool that includes a language switch between English and Chinese, but when I want to reload my window or switch languages it results in a fatal crash in about 50-60% of the time. Sometimes crashing on the first reload/switch sometimes on a second or third.
I attempted to run it on an empty file on several computers, and attempted to remove the Chinese characters, but the error persisted in all cases.
Am I doing something incorrect?
global proc BSTarget_StartUI(){ global int $selectedLanguage; if (`window -ex BSTarget_Window` == 1){ deleteUI BSTarget_Window; } if($selectedLanguage == 0){ string $BSTarget_Window = `window -t "Blendshape Target Tool" -menuBar true -s true -vis false -mnb true -mxb true -widthHeight 400 200 BSTarget_Window`; menu -label " File "; menuItem -label "Reload" -c BSTarget_StartUI; menuItem -divider true; menuItem -label "Exit" -c ("deleteUI -window " + $BSTarget_Window); menu -label "Language - 语言"; menuItem -label "English" -c switchToEnglish; menuItem -label "中文" -c switchToChinese; window -e -s 1 -w 100 BSTarget_Window; showWindow BSTarget_Window; } else if ($selectedLanguage == 1){ string $BSTarget_Window = `window -t "混合变形目标工具" -menuBar true -s true -vis false -mnb true -mxb true -widthHeight 400 200 BSTarget_Window`; menu -label "文件"; menuItem -label "重装" -c BSTarget_StartUI; menuItem -divider true; menuItem -label "退出" -c ("deleteUI -window " + $BSTarget_Window); menu -label "Language - 语言"; menuItem -label "English" -c switchToEnglish; menuItem -label "中文" -c switchToChinese; window -e -s 1 -w 100 BSTarget_Window; showWindow BSTarget_Window; } } global proc switchToEnglish(){ global int $selectedLanguage; $selectedLanguage = 0; BSTarget_StartUI; } global proc switchToChinese(){ global int $selectedLanguage; $selectedLanguage = 1; BSTarget_StartUI; } BSTarget_StartUI;
Solved! Go to Solution.