Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(12)  |  Derive(0)  |  Import(3)
Return a javascript-compatible callable which can be used as a "bound method".

Javascript doesn't support callables, and it doesn't support bound methods,
so you can't use those in pyjamas currently.

This is an OK workaround.

        def BoundMethod(obj, method):
    """
        Return a javascript-compatible callable which can be used as a "bound method".
        
        Javascript doesn't support callables, and it doesn't support bound methods,
        so you can't use those in pyjamas currently.
        
        This is an OK workaround.
    """
    JS("""
        return function() {
            return method.apply(obj, arguments);
        };
    """)
        


src/p/y/Pyjamas-Desktop-0.1/pyjamas/RichTextEditor.py   Pyjamas-Desktop(Download)
import DOM
from pyjamas.__pyjamas__ import console
from BoundMethod import BoundMethod
from ui import Widget
 
        self.loaded = True
        self.fck = fck
        fck.Events.AttachEvent('OnSelectionChange', BoundMethod(self, self.onSelectionChange))
        fck.Events.AttachEvent('OnBlur', BoundMethod(self, self.onBlur))
        fck.Events.AttachEvent('OnFocus', BoundMethod(self, self.onFocus))
        fck.Events.AttachEvent('OnPaste', BoundMethod(self, self.onPaste))

src/p/y/pyjs-HEAD/pyjswaddons/RichTextEditor.py   pyjs(Download)
"""
 
from BoundMethod import BoundMethod
from pyjamas import logging
from pyjamas import DOM
        self.fck = fck
        fck.Events.AttachEvent('OnSelectionChange',
                               BoundMethod(self, self.onSelectionChange))
        fck.Events.AttachEvent('OnBlur', BoundMethod(self, self.onBlur))
        fck.Events.AttachEvent('OnFocus', BoundMethod(self, self.onFocus))
        fck.Events.AttachEvent('OnPaste', BoundMethod(self, self.onPaste))

src/p/y/pyjamas-0.8.1/RichTextEditor.py   Pyjamas(Download)
"""
 
from BoundMethod import BoundMethod
from pyjamas import logging
from pyjamas import DOM
        self.fck = fck
        fck.Events.AttachEvent('OnSelectionChange',
                               BoundMethod(self, self.onSelectionChange))
        fck.Events.AttachEvent('OnBlur', BoundMethod(self, self.onBlur))
        fck.Events.AttachEvent('OnFocus', BoundMethod(self, self.onFocus))
        fck.Events.AttachEvent('OnPaste', BoundMethod(self, self.onPaste))