On 18/08/12 00:20, Michael Moore wrote:
On Fri, Aug 17, 2012 at 3:35 PM, Phil Charlesworth
<[email protected] <mailto:[email protected]>> wrote:
On 17/08/12 22:50, Michael Moore wrote:
On Fri, Aug 17, 2012 at 11:34 AM, Phil Charlesworth
<[email protected] <mailto:[email protected]>> wrote:
On 16/08/12 20:12, Michael Moore wrote:
I am working with trees and I thought I had it licked.
Compatibility mode or not on the browser, I have to get
the fingertip of the pointer at the edge of the + or -
circle in the wsw octant to make it open or close with a
mouse click. Anywhere else simply selects the item.
The arrow keys work as expected.
Any suggestions? Is this another one for a special .html?
Michael
--
Michael,
This is a problem caused by the IE6 override which is
drawing the the cross etc with a canvas instead of using an
image created with a data url which is how the other browsers
do it. The stupid thing is that IE8 and 9 work OK with data
urls but the override system is currently not sufficiently
detailed to handle that.
There are three possible solutions. The first and simplest is
to set the Images property of your TreeItems to True and put
actual images in public/images/. The relevant images are
still available in pyjs/library/pyjamas/ui/public/images/.
Another way would be to fix the code in the IE6/mshtml
overrides so that it works properly but I haven't any clear
idea what the problem is so that's a long shot.
Yet another way would be check, in the override file, what
version of IE you are running and if it is IE8 or IE9
execute identical code for createImage and drawImage to thet
in the main TreeItem.py file. However, I'm hazy about whether
access to the navigator object has been implemented.
So I would try the 'Images' property as I described.
I the longer term this is a problem that needs fixing but it
impacts on the contentious issue of whether to drop IE6
support etc.
Regards,
Phil
--
Thank you very much for the information! I now have a glimmer of
hope for escaping the drudge shop with Dojo and Java to do an app
which really deserves Python. I fear I am new enough to pyjs
that I am a bit confused on setting the property. I see
setElementProperty and tree_item_foo.setElementProperty(whatever
I try) throws errors. I also notice Props and weirdProps and I
used my grabit tool to do a spreadsheet on where they occurred.
About 30 files seem to have that. Is there something else I
should be looking for before I reserve the weekend for reading code?
best regards,
Michael
--
Michael,
Sorry, it's the Tree that use the Images property, not the
TreeItems. All pyjs widgets will accept keyword arguments for
setting properties when you create them. For any keyword which
they will accept, there will be corresponding set and get methods.
For instance, if a widget had a foo property, you would include
Foo = something after the positional arguments when you created
the widget, or you could set the property after creating the
widget by calling setFoo on the widget, as in
myWidget.setFoo(something).
So, either include Images = True in the argument list
when you create the Tree, or afterwards do myTree.setImages(True)
Hope that makes things clearer.
Regards,
Phil
--
Thank you once again for your help. you were right time one... It
doesn't happen on tree creation or on setting images--seems Tree and
TreeItem both lack setters for those properties.
It happens at
DOM.setStyleAttribute(item.getElement(), "cursor", "pointer", "images")
inside def createItem(self, label, value=None):, and all that is
required is the word in quotes.
But your hints saved my hair for the barber.. Of course my software
won't work with IE6, but I will personally upgrade the lone remainig
IE6 user among my limited clientele.
Many thanks,
Michael
--
Michael,
Looking at the source for Tree, it does have a setter and getter
for Images but the the code for TreeItem is not using the value any
longer so it's not possible to use external images, which is a pity and
probably an unintended consequence of the changes which introduced data
urls for creating the images internally.
Anyway, glad that you are making progress but I don't quite understand
your explanation of what you've done. Can you explain which pyjs module
you have modified, or are you modifying your application code? Also, you
seem to be calling DOM.setStyleAttribute with 4 arguments but it only
takes three.
Regards,
Phil
--