Use the attributes and methods with the same name of a class
Cristian Danilo Ramirez Vargas <[email protected]> Mon, 11 Sep 2017 18:10:24 -0500
| Newsgroups | gmane.comp.lang.jython.user |
|---|---|
| Message-ID | <CAL33trUaMHJbfoMCuUfquf4G2LO9siELZmcFqOE75apFi=Y0Zw@mail.gmail.com> |
Hi, I'm Cristian.
I'm working in Jython for use the processing's core but I have a problem to
translate this example https://processing.org/tutorials/gettingstarted/ to
Jython, because the class PApplet have a method and an attribute with the
same name (mousePressed).
The PApplet's source code is:
https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java
.
And the code that I have is:
from processing.core import PApplet
class test(PApplet):
def settings(self):
self.size(480, 120)
def draw(self):
if self.mousePressed:
self.fill(0)
else:
print type(self.mousePressed)
self.fill(255)
self.ellipse(self.mouseX, self.mouseY, 80, 80)
if __name__ == "__main__":
processingArgs = ["test"]
myProcessingSketch = test()
myProcessingSketch.runSketch(processingArgs)
Thank you for your time (and sorry for the bad english :p)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users