Esempio n. 1
0
 def __init__(self, message, sender):
     Gui.__init__(self)
     self.title('Popup')
     self.la(text='From: %s' % sender)
     self.la(text=message)
     self.bu(text='Close', command=self.destroy)
     self.mainloop()
Esempio n. 2
0
 def __init__(self, message, sender):
     Gui.__init__(self)
     self.title('Popup')
     self.la(text='From: %s' % sender)
     self.la(text=message)
     self.bu(text='Close', command=self.destroy)
     self.mainloop()
Esempio n. 3
0
    def __init__(self, debug=False, pedantic=False):
        """Initializes Lumpy.

        Args:
            debug: boolean that makes the outlines of the frames visible.
            pedantic: boolean whether to show aliasing for simple values.

        If pedantic is false, simple values are replicated, rather
        than, for example, having all references to 1 refer to the
        same int object.
        """
        Gui.__init__(self, debug)
        self.pedantic = pedantic
        self.withdraw()

        # initially there is no object diagram, no class diagram
        # and no representation of the stack.
        self.od = None
        self.cd = None
        self.stack = None

        # instance_vars maps from classes to the instance vars
        # that are drawn for that class; for opaque classes, it
        # is an empty list.

        # an instance of an opaque class is shown with a small empty box;
        # the contents are not shown.
        self.instance_vars = {}

        # the following classes are opaque by default
        self.opaque_class(Lumpy)
        self.opaque_class(object)
        self.opaque_class(type(make_thing))  # function
        self.opaque_class(Exception)
        self.opaque_class(set)  # I don't remember why

        # any object that belongs to a class in the Tkinter module
        # is opaque (the name of the module depends on the Python version)
        self.opaque_module(tkinter_module)

        # by default, class objects and module objects are opaque
        classobjtype = type(Lumpy)
        self.opaque_class(classobjtype)
        modtype = type(inspect)
        self.opaque_class(modtype)

        # the __class__ of a new-style object is a type object.
        # when type objects are drawn, show only the __name__
        self.opaque_class(type)

        self.make_reference()
Esempio n. 4
0
    def __init__(self, delay=0.5, *args, **kwds):
        Gui.__init__(self, *args, **kwds)
        self.delay = delay
        self.title('World')

        # keep track of the most recent world
        World.current_world = self

        # set to False when the user presses quit.
        self.exists = True

        # list of animals that live in this world.
        self.animals = []

        # if the user closes the window, shut down cleanly
        self.protocol("WM_DELETE_WINDOW", self.quit)
Esempio n. 5
0
    def __init__(self, args=['']):
        Gui.__init__(self)
        self.parse_args(args)
        self.namer = Namer()

        self.locals = sim_locals
        self.globals = sim_globals

        self.views = {}
        self.w = self
        self.threads = []
        self.running = False
        self.delay = 0.2
        self.setup()
        self.run_init()
        for col in self.cols:
            col.create_thread()
Esempio n. 6
0
 def __init__(self):
     Gui.__init__(self)
     self.title('GraphWorld')
     self.setup()
 def __init__(self):
     Gui.__init__(self)
     self.title('GraphWorld')
     self.setup()