Re: How to get the properties defined in a Widget Extension
Posted: Thu May 16, 2024 11:59 am
HEY! Just had a play with this one, this is probably the best IDE handler to use to build an Widget Inspector from:
Given an extension 'kind' ID revIDEExtensionPropertiesInfo returns and array of ALL of the properties for that kind, and includes the elements with the details about each property such as the editor to use, value range, etc.
if that 'tOrganize' parameter is true, then it makes the top level of the returned array be the inspector section (basic, color, text, etc.),if any, that the property should be displayed in, with the 2nd level of array being a single element ["grouplist"] which is an array/list of the properties that should go in that section.
The Tree View Widget is sooooo incredibly useful for looking at array structure, I don't why it took me so long to start using it! I'm using it constantly now. Most of the IDE uses arrays to store its infos.
Try setting its arrayData to the revPrefs props:
Code: Select all
put true into tOrganize
put revIDEExtensionPropertiesInfo( "com.livecode.widget.treeview", tOrganize) into tArray
if that 'tOrganize' parameter is true, then it makes the top level of the returned array be the inspector section (basic, color, text, etc.),if any, that the property should be displayed in, with the 2nd level of array being a single element ["grouplist"] which is an array/list of the properties that should go in that section.
The Tree View Widget is sooooo incredibly useful for looking at array structure, I don't why it took me so long to start using it! I'm using it constantly now. Most of the IDE uses arrays to store its infos.
Try setting its arrayData to the revPrefs props:
Code: Select all
set the arrayData of widget "Tree View" to the customProperties of stack "revPreferences"