# for switching tabs via HAL buttons in GladeVCP panel from subprocess import Popen, PIPE scanNumber = 0 def user_live_update(): global scanNumber #note: with the following three lines in here, AXIS hangs at the point of trying to select a certain tab if Popen('halcmd getp fff.tab-trigger',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE': root_window.tk.call('.pane.top.right','raise','preview') Popen('halcmd setp file.tab-trigger false',stdout=PIPE,shell=True) try: happy = hal.component_exists('gladevcp') if happy: if scanNumber == 0: if Popen('halcmd getp gladevcp.backplot',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE': root_window.tk.call('.pane.top.right','raise','preview') if Popen('halcmd getp gladevcp.probe',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE': root_window.tk.call('.pane.top.right','raise','user_0') if Popen('halcmd getp gladevcp.toolchange',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE': root_window.tk.call('.pane.top.right','raise','user_1') scanNumber = 1 else: if Popen('halcmd getp gladevcp.file',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE': root_window.tk.call('.pane.top.right','raise','user_2') scanNumber = 0 except Exception: traceback.print_exc() #remove "do you really want to exit?" root_window.tk.call("wm","protocol",".","WM_DELETE_WINDOW","destroy .") #start fullscreen root_window.tk.call("wm","geometry",".","1920x1000") #root_window.attributes("-fullscreen",1)