Skip to content

Commit 969ee42

Browse files
committed
Fix missed Tcl9/tk9 problems and tkinter interaction.
1 parent 6f0bf8b commit 969ee42

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/python/rs274/OpenGLTk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ def tkPrint(self, file):
380380
self.activate()
381381

382382
def zoomwheel(self, event):
383-
if event.delta > 0: self.zoomin(event)
384-
else: self.zoomout(event)
383+
if event.delta > 0: self.zoomin()
384+
else: self.zoomout()
385385

386386
def tkStartZoom(self, event):
387387
self.startZoom(event.y)

src/emc/usr_intf/axis/extensions/togl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ int Togl_Configure(Tcl_Interp *interp, struct Togl *togl,
10571057
int oldStencilSize = togl->StencilSize;
10581058
int oldAuxNumber = togl->AuxNumber;
10591059

1060-
#if TCL_MAJOR_VERSION >= 9
1060+
#if TK_MAJOR_VERSION >= 9
10611061
// Version 9+ uses Tcl_Obj* array as config whereas older uses a char* array
10621062
Tcl_Obj **optr = calloc(argc+1, sizeof(*optr)); // argc+1 to terminate list with a NULL pointer
10631063
for(int u = 0; u < argc; u++) {
@@ -1070,7 +1070,7 @@ int Togl_Configure(Tcl_Interp *interp, struct Togl *togl,
10701070
argc, (void *)optr, (char *)togl, flags) == TCL_ERROR) {
10711071
return(TCL_ERROR);
10721072
}
1073-
#if TCL_VERSION_MAJOR >= 9
1073+
#if TK_VERSION_MAJOR >= 9
10741074
for(int u = 0; u < argc; u++) {
10751075
Tcl_DecrRefCount(optr[u]);
10761076
}

src/emc/usr_intf/axis/scripts/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ def __init__(self, title, text, default, unit_str=''):
16601660
self.buttons = f = Tkinter.Frame(t)
16611661
self.ok = Tkinter.Button(f, text=_("OK"), command=self.do_ok, width=10,height=1,padx=0,pady=.25, default="active")
16621662
self.cancel = Tkinter.Button(f, text=_("Cancel"), command=self.do_cancel, width=10,height=1,padx=0,pady=.25, default="normal")
1663-
v.trace("w", self.check_valid)
1663+
v.trace_add("write", self.check_valid)
16641664
t.wm_protocol("WM_DELETE_WINDOW", self.cancel.invoke)
16651665
t.bind("<Return>", lambda event: (self.ok.flash(), self.ok.invoke()))
16661666
t.bind("<KP_Enter>", lambda event: (self.ok.flash(), self.ok.invoke()))
@@ -1769,7 +1769,7 @@ def __init__(self, title, text_pattern, default, tool_only, defaultsystem):
17691769
f = Frame(t)
17701770
self.c = c = StringVar(t)
17711771
c.set(defaultsystem)
1772-
c.trace_variable("w", self.change_system)
1772+
c.trace_add("write", self.change_system)
17731773
if not tool_only:
17741774
l = Label(f, text=_("Coordinate System:"))
17751775
mb = OptionMenu(f, c, *systems)

0 commit comments

Comments
 (0)