You aren't annoying me, no worries, its good thing for me to have explain / defend my position on this and discussing the IDE is why we're here.
Yes, I suppose so - but then what can't be done with groups of classic controls that you can specifically do with Widgets instead?
LOTS of things...
First...
I mean the DataGrid is basically a stack/script based widget, but I wouldn't called that less complicated.
On the other hand, I have some nice stack/script based 'widgets' that are useful right now in my revOXTObjects library, such as HH's graphic object based rotary control, that is fairly simple, with one or two custom properties. I similarly made my 'piano widget' as graphics objects originally.
But even the base default 'classic controls' are created based on data in files in the IDE, that's how I was able to add 'Filled Button" style (originally I called it a 'macOS style' button) as a NEW 'classic control'.
On the Widget side...
Everything in a widget is externalized, no need for the user to edit anything, just set the use_visible properties, unless they want to and then they can edit the widget at its source (since we're all FOSS here). There's never a missing button icon image due to conflicting image IDs.
The 'regular' Widgets render visually identical on all platforms (as long as the widget doesn't specify to use a font that isn't loaded)
Unless they're 'native layer' widgets, like "Mac Native Button", "Android Native Field", etc.), which they can be.
They run in the UI thread, separate from the script execution thread.
They're pre-compiled byte code (potentially faster execution)
They render faster for the most part (that could depend on how its coded)
They render 'sub-pixel' accuracy on HiDPI screens (like Retina displays, 2K,4K+).
They can use, or be driven by, System APIs via the Foreign Function Interface, like in the Browser Widget or in my Apple PDFKit Widget.
Theoretically a widget could display
either 'native' layer, system provided UI Widget OR a custom drawn control (and someday I'll test this Idea).
They can be loaded and unloaded from memory (including dictionary entrees) in a modular, isolated way. They sort of run in their own little sandbox.
You can't say for sure how to know what value any given key of that widget array it's looking for, so I would say 'makes sense' is a bit inaccurate.
They make sense in the same way that the classic controls make sense to me now... their properties, default values, PI editors, etc. are defined by a set of data (tabbed-text data lists), the data just cannot be stored in the same way for Widgets due to their modular nature.
How do you know what a 'classic control' property expects for a value? Take for a 'standard' property for example "traversOn", Is that a boolean string (yes), or numeric? Could it be enumerated as "on, off"? You know because you looked it up in the dictionary, right? But its values / range is actually set from that tabbed data .tsv file.
I'm 100% sure there are methods to get the expected value type and allowed range for every property of every widget (that's not user_visible = false), because the rev prop Inspector does this already (of course there might be some spaghetti wiring to untangle there), but I do have to look into it more thoroughly to see how they did it.
Admittedly it probably makes sense to me in part because I've made and looked at the source for a bunches of widgets, and I'm familiar with the way properties are defined in them. But I'm pretty sure I could write a handler that parses the data directly from the extensions install_folder from it's xml or even directly from the .lcb file, but I'm sure it would be easier to use whatver method rev Prop Inspector is using already uses.
I would love to, if only we had an example stack that I can place any widget on, and can reliably know what to set the various properties as. At the moment, seems like I'd have to loop through all the properties, reading each one, comparing if it should be editable, (should it not actually be user-editable even if it seems like it should?), then who-knows what it's expecting the properties of each element to be - so at best any inspector is just an array key reader, without knowing what to write back - otherwise it'll just create bucket-loads of errors.
Yes, I'm sure the current rev PI does exactly that (iterates through a list of properties stored in arrays) for all controls, including widget controls).
How are you doing it now for classic controls? Are you using idePropertyNames( pObjType ) or are you making assumptions about what properties get which editor based on pre-exising knowledge of each of the 'classic controls'? If so that might be OK, maybe even a few milliseconds faster, so long as those controls are never changed which could then break your Inspector.
OpenXTalkPaul wrote: ↑Tue May 14, 2024 4:20 pm
In fact I've been thinking the Extension packaging format could also be used to deliver 'example stacks' without any extension in the package. Those .lce files are really just zipped-up folders.
Yes, I found that out purely by mistake by unzipping one of those. I don't think that was documented anywhere either.
Agreed, the docs need work.