#root_window.tk.call("wm","geometry",".","1024x768")
root_window.attributes("-fullscreen",1)
def my_error_task(self):
        error = e.poll()
        while error: 
            kind, text = error
            if kind in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR):
                icon = "error"
            else:
                icon = "info"
            notifications.add(icon, text)
            ucomp["error"]=True
            error = e.poll()
        self.error_after = self.win.after(200, self.error_task)

def my_remove(self, widgets):
    self.widgets.remove(widgets)
    if len(self.cache) < 10:
        widgets[0].pack_forget()
        self.cache.append(widgets)
    else:
        widgets[0].destroy()
    if len(self.widgets) == 0:
        ucomp["error"]=False
        self.place_forget()

LivePlotter.error_task = my_error_task
Notification.remove = my_remove

if hal_present == 1 :
    ucomp = hal.component("probe.user")
    ucomp.newpin("error",hal.HAL_BIT,hal.HAL_IN)
    ucomp.ready()

def bind_axis(a, b, d):
    root_window.bind("<KeyPress-%s>" % a, kp_wrap(lambda e: jog_on(d, -get_jog_speed(d)), "KeyPress"))
    root_window.bind("<KeyPress-%s>" % b, kp_wrap(lambda e: jog_on(d, get_jog_speed(d)), "KeyPress"))
    root_window.bind("<Shift-KeyPress-%s>" % a, lambda e: jog_on(d, -get_max_jog_speed(d)))
    root_window.bind("<Shift-KeyPress-%s>" % b, lambda e: jog_on(d, get_max_jog_speed(d)))
    root_window.bind("<KeyRelease-%s>" % a, lambda e: jog_off(d))
    root_window.bind("<KeyRelease-%s>" % b, lambda e: jog_off(d))
    
bind_axis("Up", "Down", 1)