Changing the identifier of a widget in a stack?

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
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Changing the identifier of a widget in a stack?

Post by trevordevore » Fri Mar 13, 2015 4:42 pm

Is there a way to change the <identifier> of a widget that has already been added to a stack? I just registered my developer id on the public version of the extension store and I it will require changing the <identifier> I've used on widgets I've built thus far. The problem is I've already added the widgets to stacks I'm working on. Anyway to update them without having to recreate?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

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

Re: Changing the identifier of a widget in a stack?

Post by LCMark » Fri Mar 13, 2015 5:18 pm

@trevordevore: Hmmm - at the moment no... The 'kind' property for widgets is 'read-only' because strictly-speaking you can't change the kind of the widget (the internal serialized data a widget holds is only pertinent to the type is created as).

In the future we will probably need to add a way to 'redirect' one widget kind to the renamed version - for example if a widget goes from being community to dual-licensed with its own commercial domain; or ownership of the widget maintenance changes.

For now, I'll file a enhancement request for an internal command to do the renaming - unsupported and only to be used 'if you know what you are doing'.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Changing the identifier of a widget in a stack?

Post by trevordevore » Fri Mar 13, 2015 5:19 pm

That works. Thanks.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

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

Re: Changing the identifier of a widget in a stack?

Post by LCMark » Fri Mar 13, 2015 5:34 pm

I've filed this as: http://quality.runrev.com/show_bug.cgi?id=14942

Of course, on reflection I wonder if 'kind' should be read-write... If the OnLoad mechanism for the new kind throws an error for the data it has, the engine can just bind it as if there is no backing data. So, one option might be to make 'kind' read-write, and then it would be a simple loop in script to rekindify the widgets on a stack.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Changing the identifier of a widget in a stack?

Post by trevordevore » Fri Mar 13, 2015 5:38 pm

I like the sound of that. Losing the backing data makes sense if the new kind isn't compatible.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “LiveCode Builder”