[Kst] JS and Kst
George Staikos
staikos at kde.org
Fri Dec 2 17:58:22 CET 2005
On Thursday 01 December 2005 20:11, Andrew Walker wrote:
> A few general comments on using JS in Kst:
>
> 1) If I enter commands from the JS console the objects
> I create/move/resize are not updated until Kst repaints
> for some other reason.
That shouldn't happen. testgraphics.js works for me. Does it not work for
you?
> 2) There should be a way to determine the size of a window.
The size of a window is not very meaningful. It's the size of the view that
matters, and that's already available. Window sizes are not even constant
since chrome changes can happen.
> 3) When I type "exit" into the JS console and then run the
> data wizard whatever windows and plots I create in the
> data wizard do not appear
Does this happen if you use the external kstcmd instead of the embedded
one? I suspect not... There is a bug (in KMDI I think) that causes us to
completely lose our views when the embedded terminal is closed.
> 4) The result of typing a command into the JS console
> should probably be indented so that it is easier to see
I don't follow this one. What do you mean?
> 5) If the result of typing a command into the JS console
> is "undefined" it would probably be better to not display anything
> e.g. ellipse.move(pt); would not print anything on the next line
This is how JavaScript works. Everything returns an object, some of those
are undefined. We might be able to put a hack into the dcop call that strips
this undefined out, but it's not as simple as doing it by looking for the
string. For instance:
foo="undefined"
foo
This -should- return the string undefined too.
> 6) Is there any reason that the concept of plot groups is not
> supported?
Just not implemented yet. There are lots of things unimplemented, and I
keep a running list in extensions/js/bindings.txt. I noticed it's a bit
stale at the moment.
> 7) There is documentation on CubicBezier but I don't seem able to
> create such an object. Although the code is still present in Kst
> I don't think it is connected to anything in either JS or the GUI.
That was stale documentation. I removed it. The next doc regeneration will
update the index.
> 8) It would be nice to have a DataMatrix constructor that would create
> a DataMatrix from a gradient, as can be done from the GUI
Sure, for 1.2.1 or 1.3.0. I'm not sure if we should update the script
language in a minor release.
> 9) Kst.windows[0].plot[0].legend; returns null rather than a legend object
Is there a legend on that plot? It doesn't create a legend, it just returns
apointer to it if it exists. It would be very unfortunate if accessing a
plot's properties resulted in a legend being created.
> 10) Is there any reason for the "enabled" and "front" properties of the
> Legend object being string values rather than boolean values?
Those properties don't exist as far as I know.
> 11) Its not clear to me how I would actually get an instance of a
> DebugLogEntry. I would have expected an entry in the DebugLog
> but cannot see anything there.
Right, it's not implemented yet.
> Other than these relatively minor problems it looks good. I think a chart
> of the relationships between all the classes would make things much easier
> for people.
Agreed. Shouldn't be too hard to make one of these from the XML file after
the important 1.2.0 things are done.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the Kst
mailing list