Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4131807
By: fabioz

No, you don't need a jython installation (it will use the jython that comes
bundled with pydev in the scripting engine).

The problem in your case is that your code is executed in a thread... what you
want to do is register some action and then put your code in that action (which
will be executed in an ui thread)... take a look at the pyedit_example2.py to
see how you do that.

Still, if you wanted to execute something that needed ui access in this thread,
you'd can use the code below (you can use it for testing, but it is not the
way you should do it in the end...)

from org.eclipse.swt.widgets import Display [EMAIL PROTECTED]
from java.lang import Runnable

def myMethod():
    print 'executing in ui thread'


class RunInUi(Runnable):
    '''Helper class that implements a Runnable (just so that we
    can pass it to the Java side). It simply calls some callable.
    '''
   
    def __init__(self, c):
        self.callable = c
    def run(self):
        self.callable ()
       
def runInUi(callable):
    '''
    @param callable: the callable that will be run in the UI
    '''
    Display.getDefault().asyncExec(RunInUi(callable))
   
runInUi(myMethod)


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pydev-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to