folks hi,

this is luke, the lead developer of the python port of GWT.  we
regularly track the GWT source code, to the point of having 3
different semi-automated java-to-python converters of varying levels
of sophistication, and the reason for doing that is to save vast
amounts of time and resources, because the GWT source code is much
more tested.

_very_ occasionally we find a bug in GWT which has been transferred -
verbatim - from the direct translation to python.  it would be very
good, therefore, to have peoples' input on this issue, and to have a
discussion of this bug which could affect users of both GWT and
pyjamas.

the issue is this: a user has created a Tree and has placed TreeItems
in it, and then attached a CheckBox onto the TreeItem.  the problem is
that in these CheckBoxes, no onClicks or any other kind of event
handling occur, period.

now, i'm dead impressed that this new pyjamas developer then went and
delved into the pyjs ui source code and found the problem _and_
created a fix:
http://code.google.com/p/pyjamas/issues/?id=638

diff --git a/library/gwt/ui/TreeItem.py b/library/gwt/ui/TreeItem.py
index f5c0489..d5a413f 100644
--- a/library/gwt/ui/TreeItem.py
+++ b/library/gwt/ui/TreeItem.py
@@ -127,10 +127,18 @@ class TreeItem(UIObject):
         return item

     def onAttach(self):
-        pass
+        for item in self.children:
+            item.onAttach()
+        w = self.getWidget()
+        if w:
+           w.onAttach()

     def onDetach(self):
-        pass
+        for item in self.children:
+            item.onDetach()
+        w = self.getWidget()
+        if w:
+           w.onDetach()

     def getChild(self, index):
         if (index < 0) or (index >= len(self.children)):

so, the question that i have is very simple: is this the right thing
to do?  remember that, as we didn't design the GWT UI widget
infrastructure (merely "port" it pretty much verbatim to python),
analysing the implications of issues such as this is somewhat outside
of our... scope / resources / time / "community abilities" shall we
say.

plus, i believe it's important to raise this with the GWT community
not least because someone else in the GWT community may wish to do
exactly the same thing: have TreeItems where the widgets within them
bloody well work! :)

i'd be interested to hear the thoughts of the GWT community on this
issue.  fyi read-only archive of pyjamas-dev exact same topic is here:
http://groups.google.com/group/pyjamas-dev/browse_thread/thread/b69ad20a6af2085e

l.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to