On Apr 10, 2007, at 12:57 PM, <[EMAIL PROTECTED]> wrote:

> Ah.. evt.Continue() right?

        No. Dabo methods are never capitalized. 'Continue' is a property of  
the event object, so the syntax should be evt.Continue = True.

        But the problem is that unless you explicitly set that to False, or  
call evt.stop(), which does the same thing, you should *never* have  
to use this. Dabo events always continue unless explicitly stopped.

        Many times the problem is one of timing: the event is triggered  
before the default behavior occurs, which, in the case of a textbox,  
would be to append the key to the control's displayed text. That's  
where dabo.ui.callAfter() comes in: all pending processing will be  
completed before the 'called after' method executes. Typically, code  
looks like:

def onKeyChar(self, evt):
        if evt.keyChar matches some test:
                handle the behavior, and optionally call
                evt.stop()
                to prevent it from being passed on to the textbox
        else:
                dabo.ui.callAfter(self.processKey, evt.keyChar)

def processKey(self, keyChar):
        Do your 'delayed' processing here

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to