''' Created on 27-jul.-2014 @author: Simon ''' import Tkinter as tk from sccd.runtime.statecharts_core import Event class Widget: controller = None def __init__(self, configure_later=False, inport="input", outport="output"): if not configure_later: self.set_bindable_and_tagorid(None, None) self.inport = inport self.outport = outport def set_bindable_and_tagorid(self, bindable=None, tagorid=None): if bindable is None: bindable = self self.bindable = bindable self.mytagorid = tagorid if isinstance(self, tk.Toplevel): self.protocol("WM_DELETE_WINDOW", self.window_close) if tagorid is not None: if not isinstance(tagorid, list): tagorid = [tagorid] for t in tagorid: self.bindable.tag_bind(t, "