Nicolas
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/aca2a2fb-e8d4-d53d-ad3c-09bbbe6947b2%40famillepinault.fr.
For more options, visit https://groups.google.com/d/optout.
This is not what I want to achieve.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CAB-sx62QhFxKnbUYyVE5H2-XP19rOkjd1BVL6hNcoPCBOQqxEw%40mail.gmail.com.
Hi Kiko,
Le 22/05/2016 à 22:55, Kiko a écrit :
This is not what I want to achieve.
In my case, I have a single script with many modules.
Ideally, I would be able to attach a Brython object to a html element.
Something like :
module 1 :
import module2
class MyClass() :
def __init__(self) :
d = html.DIV(id='myid')
d.brython_obj = self # <--------- javascript object has an attribute referencing Brython object
document <= d
mc = Myclass()
module2.dosomething()
module 2 :
def dosomething():
mc = document["myid"].brython_obj
mc.d.text += ' Added text.'
You will say I just have to pass mc as an argument to dosomething(). But for some reason, I don't want to (my actual application is much more complex).
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/2acb6af4-fb19-dc02-4194-96bbcc7487a3%40famillepinault.fr.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CAB-sx61kYwp%3Df0W%3DQxs6M3NFkBNoUpXCMMX1Z4-7mem%3D3fD-%3Dw%40mail.gmail.com.
evt = DOMEvent(
evt_name)
evt.attr = my_obj
element.dispatchEvent(evt
)
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/6ab13438-32d8-4e5c-bb0a-e605b33b0e3e%40googlegroups.com.