Page 1 of 1

widget preferred size

Posted: Thu Oct 08, 2015 7:52 pm
by mwieder
The documentation for 'create widget' in the dictionary shows only a pretty simple example. If I create a widget, it comes up in a 128 x 32 pixel size. Is there a suggested way to use the preferred size from the manifest.xml file on widget creation?

For example, the 'clock' widget has a preferred size of 76 x 76 pixels.

Re: widget preferred size

Posted: Thu Oct 08, 2015 10:52 pm
by mwieder
Actually, I can't find any documentation at all on the manifest.xml file.

Re: widget preferred size

Posted: Fri Oct 09, 2015 9:30 am
by livecodeali
Should you want to use the IDE library for this, you could take a look at the script of stack "revIDEExtensionLibrary".
There is a function

Code: Select all

function revIDEExtensionProperty pKind, pProperty
from which you can obtain data from the manifest.

For example,

Code: Select all

revIDEExtensionProperty "com.livecode.widget.clock", "preferredSize"
will give you that data, provided the widget is installed.

Re: widget preferred size

Posted: Fri Oct 09, 2015 11:16 pm
by mwieder
Thanks, Ali - that's useful.
But since I'm already generating an xml tree in order to get the name/type data, I'm using something similar to the repeat loop in revIDEExtensionFetchMetadata to get the preferredSize metadata attribute. Just wasn't sure if there was an officially condoned way to get info out of the manifest file.

Re: widget preferred size

Posted: Sat Oct 10, 2015 2:03 pm
by LCMark
@mwieder: The revIDEExtensionsFetchMetadata() function is the 'condoned way' to get the information. It means that if we have to change the manifest format for any reason, any components built on top of the IDE API will continue to work as they did before without changes.