widget preferred size

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

widget preferred size

Post by mwieder » Thu Oct 08, 2015 7:52 pm

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: widget preferred size

Post by mwieder » Thu Oct 08, 2015 10:52 pm

Actually, I can't find any documentation at all on the manifest.xml file.

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 192
Joined: Thu Apr 18, 2013 2:48 pm

Re: widget preferred size

Post by livecodeali » Fri Oct 09, 2015 9:30 am

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: widget preferred size

Post by mwieder » Fri Oct 09, 2015 11:16 pm

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.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1211
Joined: Thu Apr 11, 2013 11:27 am

Re: widget preferred size

Post by LCMark » Sat Oct 10, 2015 2:03 pm

@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.

Post Reply

Return to “LiveCode Builder”