<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import linuxcnc
s = linuxcnc.stat()
s.poll()


### we will change this back to w later  ####
rC = root_window.tk.call



############################################
#######      MOVE THE GCODE   ##############
############################################

# remove bottom pane
rC('.pane','forget','.pane.bottom')

# new auto tab with gcode text
rC('.pane.top.tabs','insert','end','auto','-text',' Auto ')
rC('.pane.top.tabs.fauto','configure','-borderwidth',2)
rC('frame','.pane.top.tabs.fauto.t','-borderwidth',2,'-relief','sunken','-highlightthickness','1')
rC('text','.pane.top.tabs.fauto.t.text','-borderwidth','0','-exportselection','0','-highlightthickness','0','-relief','flat','-takefocus','0','-undo','0')
rC('bind','.pane.top.tabs.fauto.t.text','&lt;Configure&gt;','goto_sensible_line')
rC('scrollbar','.pane.top.tabs.fauto.t.sb','-width',25,'-borderwidth','0','-highlightthickness','0')
rC('.pane.top.tabs.fauto.t.text','configure','-state','normal','-yscrollcommand',['.pane.top.tabs.fauto.t.sb','set'])
rC('.pane.top.tabs.fauto.t.sb','configure','-command',['.pane.top.tabs.fauto.t.text','yview'])
rC('pack','.pane.top.tabs.fauto.t.sb','-fill','y','-side','left')
rC('pack','.pane.top.tabs.fauto.t.text','-expand','1','-fill','both','-side','right')
rC('pack','.pane.top.tabs.fauto.t','-fill','both')

# create a new widget list so we can "move" the gcode text
widget_list_new = []
for widget in widget_list:
    if '.t.text' in widget[2]:
        widget = ('text', Text, '.pane.top.tabs.fauto.t.text')
    widget_list_new.append(widget)
    widget_list_new.append(('edit', Text, '.pane.top.tabs.fedit.t.text'))
widgets = nf.Widgets(root_window,*widget_list_new)

# copied from axis.py (line 3857) to assign the "new" widgets.text to t
t = widgets.text
t.bind('&lt;Button-3&gt;', rClicker)
t.tag_configure("ignored", background="#ffffff", foreground="#808080")
t.tag_configure("lineno", foreground="#808080")
t.tag_configure("executing", background="#804040", foreground="#ffffff")
t.bind("&lt;Button-1&gt;", select_line)
t.bind("&lt;Double-Button-1&gt;", release_select_line)
t.bind("&lt;B1-Motion&gt;", lambda e: "break")
t.bind("&lt;B1-Leave&gt;", lambda e: "break")
t.bind("&lt;Button-4&gt;", scroll_up)
t.bind("&lt;Button-5&gt;", scroll_down)
t.configure(state="disabled")



######################################
##########   Addition to GCODE #######
######################################
rC('labelframe','.pane.top.tabs.fauto.program')
#rC('labelframe','.pane.top.tabs.fauto.program','-text','File')
rC('pack','.pane.top.tabs.fauto.program','-before','.pane.top.tabs.fauto.t','-fill','x')

#rC('label','.pane.bottom.program.line','-text','line','-font','mono 12','-justify','left')
#rC('grid','.pane.bottom.program.line','-column','0','-row','0')
rC('label','.pane.top.tabs.fauto.program.name','-text','file','-font','mono 12','-justify','left')
rC('pack','.pane.top.tabs.fauto.program.name','-side','left')
rC('label','.pane.top.tabs.fauto.program.time','-text','HH:MM:SS','-font','mono 12','-justify','right')
rC('pack','.pane.top.tabs.fauto.program.time','-side','right')

######################################
#######  end Addition to GCODE #######
######################################

############################################
#######  MOVE THE GCODE/new key binds ######
############################################
def select_next_line(self):
    if o.highlight_line is None:
        i = 1
    else:
        i = max(o.last_line, o.highlight_line + 1)
    o.set_highlight_line(i)
    o.tkRedraw()
##############################################
#####   and do select_prev also #############
########################################
def select_prev_line(self):
    if o.highlight_line is None:
        i = o.last_line
    else:
        i = max(1, o.highlight_line - 1)
    o.set_highlight_line(i)
    o.tkRedraw()

root_window.unbind("Up")
rC('bind','.pane.top.tabs.fauto','&lt;Up&gt;',"select_prev_line")
t.bind("&lt;Key-1&gt;", select_prev_line)
t.bind("&lt;D&gt;", select_next_line)
t.bind("&lt;KP_Up&gt;", select_prev_line)
t.bind("&lt;KP_Down&gt;", select_next_line)
root_window.bind('&lt;Key-1&gt;', select_next_line)
root_window.bind('&lt;Key-2&gt;', select_prev_line)
TclCommands.select_prev_line = select_prev_line
TclCommands.select_next_line = select_next_line
############################################
#######  end MOVE THE GCODE/new key binds ##
############################################





############################################
#######  end MOVE THE GCODE   ##############
############################################




##########################################################
########       LOAS_LAST FILE   PY3  LCNC 2.9  #############
########   In ini file under [DISPLAY]  ##################
########     LOAD_LASTFILE = 	YES       ##################
##########################################################

loadlast = inifile.find('DISPLAY', 'LOAD_LASTFILE')
if loadlast == "YES" :
    load_lastfile = True
else:
    load_lastfile = False


lastfile = ""
recent = ap.getpref('recentfiles', [], repr)
if len(recent):
    lastfile = recent.pop(0)

code = []
addrecent = True
if args:
    initialfile = args[0]
elif "AXIS_OPEN_FILE" in os.environ:
    initialfile = os.environ["AXIS_OPEN_FILE"]
elif inifile.find("DISPLAY", "OPEN_FILE"):
    initialfile = inifile.find("DISPLAY", "OPEN_FILE")
elif os.path.exists(lastfile) and load_lastfile:
    initialfile = lastfile
    print ("Loading ") 
    print (initialfile)
elif lathe:
    initialfile = os.path.join(BASE, "share", "axis", "images","axis-lathe.ngc")
    addrecent = False
else:
    initialfile = os.path.join(BASE, "share", "axis", "images", "axis.ngc")
    addrecent = False

if os.path.exists(initialfile):
    open_file_guts(initialfile, False, addrecent)

###############################
######    end load last    ###############
#########################################

#########
##################################

###  do you want to exit linuxcnc
rC("wm","protocol",".","WM_DELETE_WINDOW","destroy .")





#########
##################################
#######   EDIT TAB   ######
#########
##################################
edittext = ('.pane.top.tabs.fedit.t.text')

def load_editfile():
    print (s.file)
    open_filea = open(s.file,'r')
    rC('.pane.top.tabs.fedit.t.text','delete','1.0','end')
    rC('.pane.top.tabs.fedit.t.text','insert','end',open_filea.read())
    root_window.unbind("&lt;o&gt;")
    #rC('bind','.pane.top.tabs.fedit.t.text','&lt;Key&gt;', "break")
    #rC('bind','.pane.top.tabs.fedit.t.text','&lt;Key&gt;', "print_file")
    #widgets.edit.unbind("O")
    ### UNBIND

    root_window.unbind("l")#, commands.toggle_override_limits)
    root_window.unbind("o")#, commands.open_file)
    root_window.unbind("s")#, commands.task_resume)
    root_window.unbind("t")#, commands.task_step)
    root_window.unbind("p")#, commands.task_pause)
    root_window.unbind("R")#, commands.task_reverse)
    root_window.unbind("F")#, commands.task_forward)
    root_window.unbind("v")#, commands.cycle_view)
    root_window.unbind("r")#, commands.task_run)
    root_window.unbind("B")#, commands.brake_on)
    root_window.unbind("b")#, commands.brake_off)
    root_window.unbind("x")#, lambda event: activate_ja_widget("x"))
    root_window.unbind("y")#, lambda event: activate_ja_widget("y"))
    root_window.unbind("z")#, lambda event: activate_ja_widget("z"))
    root_window.unbind("a")#, lambda event: activate_ja_widget("a"))
    root_window.unbind("c")#, lambda event: jogspeed_continuous())
    root_window.unbind("d")#, lambda event: widgets.rotate.invoke())
    root_window.unbind("i")#, lambda event: jogspeed_incremental())
    root_window.unbind("I")#, lambda event: jogspeed_incremental(-1))
    root_window.unbind("`")#, lambda event: activate_ja_widget_or_set_feedrate(0))
    root_window.unbind("1")#, lambda event: activate_ja_widget_or_set_feedrate(1))
    root_window.unbind("2")#, lambda event: activate_ja_widget_or_set_feedrate(2))
    root_window.unbind("3")#, lambda event: activate_ja_widget_or_set_feedrate(3))
    root_window.unbind("4")#, lambda event: activate_ja_widget_or_set_feedrate(4))
    root_window.unbind("5")#, lambda event: activate_ja_widget_or_set_feedrate(5))
    root_window.unbind("6")#, lambda event: activate_ja_widget_or_set_feedrate(6))
    root_window.unbind("7")#, lambda event: activate_ja_widget_or_set_feedrate(7))
    root_window.unbind("8")#, lambda event: activate_ja_widget_or_set_feedrate(8))
    root_window.unbind("9")#, lambda event: activate_ja_widget_or_set_feedrate(9))
    root_window.unbind("0")#, lambda event: activate_ja_widget_or_set_feedrate(10))
    root_window.unbind("!")#, "set metric [expr {!$metric}]; redraw")
    root_window.unbind("@")#, commands.toggle_display_type)
    root_window.unbind("#")#, commands.toggle_coord_type)
    root_window.unbind("$")#, commands.toggle_teleop_mode)
    root_window.unbind("&lt;Home&gt;")#, commands.home_joint)
    root_window.unbind("&lt;End&gt;")#, commands.touch_off_system)




def save_editfile():
    print (s.file)
    open_filea = open(s.file,'w')
    edit_gcode = rC('.pane.top.tabs.fedit.t.text','get','1.0','end-1c')
    open_filea.write(edit_gcode)
    reload_file()
  
    ########bind
    root_window.bind("l", commands.toggle_override_limits)
    root_window.bind("o", commands.open_file)
    root_window.bind("s", commands.task_resume)
    root_window.bind("t", commands.task_step)
    root_window.bind("p", commands.task_pause)
    root_window.bind("R", commands.task_reverse)
    root_window.bind("F", commands.task_forward)
    root_window.bind("v", commands.cycle_view)
    root_window.bind("r", commands.task_run)
    root_window.bind("B", commands.brake_on)
    root_window.bind("b", commands.brake_off)
    root_window.bind("x", lambda event: activate_ja_widget("x"))
    root_window.bind("y", lambda event: activate_ja_widget("y"))
    root_window.bind("z", lambda event: activate_ja_widget("z"))
    root_window.bind("a", lambda event: activate_ja_widget("a"))
    root_window.bind("c", lambda event: jogspeed_continuous())
    root_window.bind("d", lambda event: widgets.rotate.invoke())
    root_window.bind("i", lambda event: jogspeed_incremental())
    root_window.bind("I", lambda event: jogspeed_incremental(-1))
    root_window.bind("`", lambda event: activate_ja_widget_or_set_feedrate(0))
    root_window.bind("1", lambda event: activate_ja_widget_or_set_feedrate(1))
    root_window.bind("2", lambda event: activate_ja_widget_or_set_feedrate(2))
    root_window.bind("3", lambda event: activate_ja_widget_or_set_feedrate(3))
    root_window.bind("4", lambda event: activate_ja_widget_or_set_feedrate(4))
    root_window.bind("5", lambda event: activate_ja_widget_or_set_feedrate(5))
    root_window.bind("6", lambda event: activate_ja_widget_or_set_feedrate(6))
    root_window.bind("7", lambda event: activate_ja_widget_or_set_feedrate(7))
    root_window.bind("8", lambda event: activate_ja_widget_or_set_feedrate(8))
    root_window.bind("9", lambda event: activate_ja_widget_or_set_feedrate(9))
    root_window.bind("0", lambda event: activate_ja_widget_or_set_feedrate(10))
    root_window.bind("!", "set metric [expr {!$metric}]; redraw")
    root_window.bind("@", commands.toggle_display_type)
    root_window.bind("#", commands.toggle_coord_type)
    root_window.bind("$", commands.toggle_teleop_mode)
    root_window.bind("&lt;Home&gt;", commands.home_joint)
    root_window.bind("&lt;End&gt;", commands.touch_off_system)
    return 1


def print_file():
    print ('breakin')
    rC('.pane.top.tabs.fedit.t.text','insert','insert', '%K')
    return "break"

def print_file2():
    print_file



rC('.pane.top.tabs','insert','end','edit','-text',' edit ','-raisecmd','load_editfile','-leavecmd','save_editfile')
#rC('.pane.top.tabs','insert','end','edit','-text',' edit ')
rC('.pane.top.tabs.fedit','configure','-borderwidth',2)
rC('frame','.pane.top.tabs.fedit.t','-borderwidth',2,'-relief','sunken','-highlightthickness','1')
#rC('text','.pane.top.tabs.fedit.t.text','-borderwidth','0','-exportselection','1','-highlightthickness','0','-relief','flat','-takefocus','1','-undo','1')
rC('text','.pane.top.tabs.fedit.t.text','-borderwidth','0','-relief','flat','-takefocus','1','-undo','1')

#rC('bind','.pane.top.tabs.fedit.t.text','&lt;Configure&gt;','goto_sensible_line')
rC('scrollbar','.pane.top.tabs.fedit.t.sb','-width',25,'-borderwidth','0','-highlightthickness','0')
rC('.pane.top.tabs.fedit.t.text','configure','-yscrollcommand',['.pane.top.tabs.fedit.t.sb','set'])
rC('.pane.top.tabs.fedit.t.sb','configure','-command',['.pane.top.tabs.fedit.t.text','yview'])
rC('pack','.pane.top.tabs.fedit.t.sb','-fill','y','-side','left')
rC('pack','.pane.top.tabs.fedit.t.text','-expand','1','-fill','both','-side','right')
rC('pack','.pane.top.tabs.fedit.t','-fill','both')


   


###### test entry  ####

rC('button','.pane.top.tabs.fedit.edit','-text','edit','-command','load_editfile')
rC('button','.pane.top.tabs.fedit.save','-text','save','-command','save_editfile')
#rC('pack','.pane.top.tabs.fedit.edit','-side','left')
#rC('pack','.pane.top.tabs.fedit.save','-side','left')


######################################
##########   Addition to EDIT #######
######################################
rC('labelframe','.pane.top.tabs.fedit.program')
#rC('labelframe','.pane.top.tabs.fedit.program','-text','File')
rC('pack','.pane.top.tabs.fedit.program','-before','.pane.top.tabs.fedit.t','-fill','x')

#rC('label','.pane.bottom.program.line','-text','line','-font','mono 12','-justify','left')
#rC('grid','.pane.bottom.program.line','-column','0','-row','0')
rC('label','.pane.top.tabs.fedit.program.name','-text','file','-font','mono 12','-justify','left')
rC('pack','.pane.top.tabs.fedit.program.name','-side','left')
rC('label','.pane.top.tabs.fedit.program.time','-text','EDIT','-font','mono 12','-justify','right')
rC('pack','.pane.top.tabs.fedit.program.time','-side','right')

######################################
#######  end Addition to EDIT #######
######################################



#########
##################################
#######   end EDIT TAB   ######
#########
##################################


#################################
##########   saize config   ####################
########################################

rC('.pane.top.tabs','itemconfigure','manual','-text',' MANUAL ')
rC('.pane.top.tabs','itemconfigure','mdi','-text',' MDI ')
rC('.pane.top.tabs','itemconfigure','auto','-text',' AUTO ')
rC('.pane.top.tabs','itemconfigure','edit','-text',' EDIT ')
rC('.pane.top.right','itemconfigure','preview','-text',' PREVIEW ')
rC('.pane.top.right','itemconfigure','numbers','-text',' DRO ')


toolbar_right = inifile.find('DISPLAY', 'TOOLBAR_RIGHT')
if toolbar_right == "YES" :
      rC('grid','forget','.info')
      root_window.tk.call(".pane","configure","-height","300",'-width','700');
      root_window.tk.call('.pane.top.tabs','configure','-width','325')
      root_window.tk.call('.pane.top.right','configure','-width','300')
      root_window.tk.call("wm","geometry",".","+0+36")
      rC('grid','forget','.pane.top.gcodel')
      rC('grid','forget','.pane.top.right')
      rC('grid','forget','.pane.top.gcodes')
      rC('grid','.pane.top.right','-sticky','nesw','-column','1','-row','1')
      rC('grid','.pane.top.gcodes','-sticky','nesw','-column','1','-row','2','-rowspan','2')
      #rC('grid','forget','.pane.top.feedoverride')
      #rC('grid','forget','.pane.top.rapidoverride')
      #rC('grid','forget','.pane.top.spinoverride')
      #rC('grid','forget','.pane.top.jogspeed')
      #rC('grid','forget','.pane.top.ajogspeed')
      rC('grid','forget','.pane.top.maxvel')
      
else:
      #root_window.tk.call(".pane","configure","-height","300",'-width','700');
      root_window.tk.call('.pane.top.tabs','configure','-width','420')
      #root_window.tk.call('.pane.top.right','configure','-width','300')
      #root_window.tk.call("wm","geometry",".","+0+36")
      rC('grid','forget','.pane.top.feedoverride')
      rC('grid','forget','.pane.top.rapidoverride')
      rC('grid','forget','.pane.top.spinoverride')
      rC('grid','forget','.pane.top.jogspeed')
      rC('grid','forget','.pane.top.ajogspeed')
      rC('grid','forget','.pane.top.maxvel')
            ############ remove active gcodes lable and codes ##########
      rC('grid','remove','.pane.top.gcodel')
      rC('grid','forget','.pane.top.gcodes')
      rC('grid','.pane.top.right','-column','1','-sticky','nesw')
      rC('grid','.pane.top.rapidoverride','-sticky','nesw','-column','1')
      rC('grid','.pane.top.feedoverride','-sticky','nesw','-column','1')
      rC('grid','.pane.top.spinoverride','-sticky','nesw','-column','1')
      rC('grid','.pane.top.jogspeed','-sticky','nesw','-column','1')
      rC('grid','.pane.top.ajogspeed','-sticky','nesw','-column','1')
      rC('grid','.pane.top.maxvel','-sticky','nesw','-column','1')
      rC('grid','.pane.top.gcodes','-column','1','-sticky','new')
      #rC('grid','forget','.pane.top.feedoverride')
      #rC('grid','forget','.pane.top.rapidoverride')
      #rC('grid','forget','.pane.top.spinoverride')
      #rC('grid','forget','.pane.top.jogspeed')
      rC('grid','forget','.pane.top.ajogspeed')
      rC('grid','forget','.pane.top.maxvel')
      
      
      #estop button
      rC(".toolbar.machine_estop","configure"
      ,"-text","ESTOP"
      ,"-activebackground","tomato2"
      #,"-background","red"
      ,"-helptext","Toggle Emergency Stop [F1]"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","26"
      ,"-relief","flat"
      );

      #powerbutton
      rC(".toolbar.machine_power","configure"
      ,"-text","POWER"
      ,"-activebackground","palegreen3"
      ,"-helptext","Toggle Machine power [F2]"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","27"
      ,"-relief","flat"
      );


      #  open file
      rC(".toolbar.file_open","configure"
      ,"-text","OPEN"
      ,"-activebackground","grey90"
      ,"-helptext","OPEN FILE"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","26"
      ,"-relief","flat"
      );


      #  reload
      rC(".toolbar.reload","configure"
      ,"-text","RELOAD"
      ,"-activebackground","palegreen1"
      ,"-helptext","RELOAD FILE"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","26"
      ,"-relief","flat"
      );

      #  run
      rC(".toolbar.program_run","configure"
      ,"-text","RUN"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","RUN"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","20"
      ,"-relief","flat"
      );

      #  STEp
      rC(".toolbar.program_step","configure"
      ,"-text","STEP"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","STEP"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","20"
      );

      #  Pause
      rC(".toolbar.program_pause","configure"
      ,"-text","PAUSE"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","PAUSE"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      );

      #  stop
      rC(".toolbar.program_stop","configure"
      ,"-text","STOP"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","ST0P"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","flat"
      );


      #  block skip
      rC(".toolbar.program_blockdelete","configure"
      ,"-text","SKIP"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","BLOCK SKIP"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","18"
      );

      #  m1 optional
      rC(".toolbar.program_optpause","configure"
      ,"-text","M1"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","M1 OPTIONAL STOP"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","solid"
      );

      #  zoom+
      rC(".toolbar.view_zoomin","configure"
      ,"-text","ZOOM"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","ZOOM IN"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","26"
      ,"-relief","flat"
      );

      #  zoom - 
      rC(".toolbar.view_zoomout","configure"
      ,"-text","ZOOM"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","ZOOM OUT"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","26 "
      ,"-relief","flat"
      );

      #  view z
      rC(".toolbar.view_z","configure"
      ,"-text","VIEW"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","VIEW Z"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","flat"
      );

      rC('pack','forget','.toolbar.view_z2')

      #  view x
      rC(".toolbar.view_x","configure"
      ,"-text","VIEW"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","VIEW X"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","flat"
      );


      #  view y
      rC(".toolbar.view_y","configure"
      ,"-text","VIEW"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","VIEW Y"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","flat"
      );


      #  view p
      rC(".toolbar.view_p","configure"
      ,"-text","VIEW"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","VIEW P"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","20"
      ,"-relief","flat"
      );

      #  view rotate
      rC(".toolbar.rotate","configure"
      ,"-text","ROTATE"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","TOGGLE ROTATE"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","1"
      ,"-width","26"
      );

      #   clear plot
      rC(".toolbar.clear_plot","configure"
      ,"-text","CLEAR"
      ,"-activebackground","lightsteelblue1"
      ,"-helptext","CLEAR PLOT"
      ,"-font","mono 10 "
      ,"-compound","top"
      ,"-borderwidth","0"
      ,"-width","20"
      ,"-relief","flat"
      );

#################################################
##### USER LIVE UPDATE ############################
#####  this is where pins get updated in ui  ###########
##################################################

rC('.pane.top.tabs','itemconfigure','edit','-state','disabled')

####### update feedrate
def user_live_update():

   ## loaded file
    rC('.pane.top.tabs.fedit.program.name','configure','-text', os.path.basename(loaded_file))
    rC('.pane.top.tabs.fauto.program.name','configure','-text', os.path.basename(loaded_file))
    print(s.task_mode) 
    if s.task_mode == 2:
      rC('.pane.top.tabs','itemconfigure','edit','-state','disabled')
    else:
      rC('.pane.top.tabs','itemconfigure','edit','-state','normal')
      

#################################################
##### USER LIVE UPDATE ############################
#####         end             ######################
##################################################
print(s.task_mode) 
print("butt") 

TclCommands.save_editfile = save_editfile
TclCommands.load_editfile = load_editfile
TclCommands.printfile = print_file

commands = TclCommands(root_window)
</pre></body></html>