from Tkinter import * import sys, os # this is a fix to get the path to the 'hal' module included # BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")) sys.path.insert(0, os.path.join(BASE, "lib", "python")) sys.path.insert(0,"/home/anders/emc2-head/lib/python/") import emc from pyvcp import * from hal import *; import time master = Tk() pycomp = component("pyvcp"); # create objects and place them in the frame w = pyvcp_scale(master, pycomp,from_=0, to=100,resolution=0.1,orient=HORIZONTAL,halpin="myscale") w.pack() b = pyvcp_button(master, pycomp,text="OK") b.pack() c = pyvcp_checkbutton(master, pycomp) c.pack() d = pyvcp_led(master,pycomp) d.pack() e = pyvcp_bar(master,pycomp) e.pack() f = pyvcp_number(master,pycomp,format="+4.3f",font=("Helvetica",20)) f.pack() g = Label(master, text="This is a label") g.pack() # update widgets / HAL pins in this loop def timer(): w.update(pycomp) b.update(pycomp) c.update(pycomp) d.update(pycomp) e.update(pycomp) f.update(pycomp) master.after(100, timer) timer() master.mainloop()