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.
widget preferred size
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: widget preferred size
Actually, I can't find any documentation at all on the manifest.xml file.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: widget preferred size
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
from which you can obtain data from the manifest.
For example,
will give you that data, provided the widget is installed.
There is a function
Code: Select all
function revIDEExtensionProperty pKind, pProperty
For example,
Code: Select all
revIDEExtensionProperty "com.livecode.widget.clock", "preferredSize"
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: widget preferred size
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.
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: widget preferred size
@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.