tperry2x wrote: ↑Thu May 16, 2024 6:14 pm
Hahaha, I find this hilarious. We were both working on the exact same thing.
widgetDataTests-v3.png

Yes it's unusual, but I think we're overdue for this sort of collaboration.
While It's still true that I have less time to actually write/test code for the IDE, I do have
some time that I can spend on researching these things because I can do that from virtually anywhere really, so this is sort of a way that I can still work on OXT IDE without actually working on OXT...
That Tree Widget isn't really relevant or used by my scripts. I just put the widgets() that there so that I could view the full Widgets() array, so that I could see the structure while writing the scripts.
I've only recently started using the 'Tree View' widget a lot more, and I've mostly used it as a quick way to inspect structure of Arrays, however, a quick look at it's docs and lcb source shows:
Code: Select all
get the hilitedElement of widget "Array Viewer"-- it = a comma delimited list of array keys ''path' such as "key1,subkey2,subsubkey5"
Which you could then use to get the actual value of the highlighted element of the array and then display it in some way.
I can't see any direct method to get the selected element's value in a more direct way as there
could be (but adding one is another sub-project I suppose).
The Tree View widget generates a few messages your scripts can respond to, probably you want to use hiliteChanged:
The <hiliteChanged> message is sent to the widget's script object when a row of the
widget's display is clicked on, causing that row to be highlighted. Use the <hilitedElement>
property to fetch the row's associated array keys.
Or maybe actionInspect message, sent when the 'inspect' icon is clicked when in read only mode.
Code: Select all
on actionInspect pElementPath
put pElementPath -- should put something like "theme,options"
put the arrayData of me into tArray
put tArray[item 1 of pElementPath][item 2 of pElementPath] -- would get the value for tArray["theme"]["options"]
end actionInspect
A bit convoluted but that should work to get those values
It seems the display is calculated to some degree based on width available to draw the text into, not sure why those values are truncated even when there's lots of space available (again, fixing that would be another sub-project).
There is a few properties such as 'readOnly' and 'arrayStyle' that effect the way the arrayData is displayed.
I do see there's a property (charsToTrimFromKey) to remove
leading characters from the display of the element key name, but not to
remove trailing characters, nor is there a property to set a minimal amount of characters to display.
"Tree View" is the same widget that's used as an editor for arrays in rev Props Inspector.