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
--