I've been developing a PyMOL plugin using Tkinter, and encountered an issue with the slider (scale) widget and an associated variable leading way to a segfault as the slider value is changed. Below is a segment of the code I've minimized as much as reasonable while still giving the error. The time it takes to segfault varies, but I haven't seen it take more than a few seconds of moving the slider.

Python Code:

import Tkinter

import pymol

def __init_plugin__(self=None):

        pymol.plugins.addmenuitem('segfaulter', main)

def main():

        root = Tkinter.Toplevel(pymol.plugins.get_tk_root())

        var = Tkinter.DoubleVar()

        slider = Tkinter.Scale(root,variable=var)


        varCallback = var.trace_variable('w', lambda x,y,z:function(var))

def function(var):


Any ideas on what might be going on, or suggestions to eliminate the error? Thank you very much!

Best Regards,