Example #1
0
    def testBindToFunction(self):
        def thatWhichMustBeCalled(newValue):
            thatWhichMustBeCalled.called = True

        thatWhichMustBeCalled.called = False
        e = Entry()
        e.bindOnChange(thatWhichMustBeCalled)
        e.set('Hello World!')
        self.assertTrue(thatWhichMustBeCalled.called)
Example #2
0
    def testBindToFunction(self):
        def thatWhichMustBeCalled(newValue):
            thatWhichMustBeCalled.called = True

        thatWhichMustBeCalled.called = False
        e = Entry()
        e.bindOnChange(thatWhichMustBeCalled)
        e.set('Hello World!')
        self.assertTrue(thatWhichMustBeCalled.called)
Example #3
0
    def testBindToMethod(self):
        class MethodHolder(object):
            def methodThatMustBeCalled(self, newValue):
                self.called = True

        e = Entry()
        methodHolder = MethodHolder()
        methodHolder.called = False
        e.bindOnChange(methodHolder.methodThatMustBeCalled)
        e.set('Hello World!')
        self.assertTrue(methodHolder.called)
Example #4
0
    def testBindToMethod(self):
        class MethodHolder(object):
            def methodThatMustBeCalled(self, newValue):
                self.called = True

        e = Entry()
        methodHolder = MethodHolder()
        methodHolder.called = False
        e.bindOnChange(methodHolder.methodThatMustBeCalled)
        e.set('Hello World!')
        self.assertTrue(methodHolder.called)