Page 1 of 1

Updating a widget in use

Posted: Sun Dec 09, 2018 11:52 am
by pink
So I have a widget I created that I am currently using in several stacks. How do I test and install changes to a widget without messing up my stacks?

Let me give an example... I have a widget where I needed to add "pass onMouseMove" in the script in order to make it move (obviously). So my procedure:
1. Closed and removed from memory all stacks
2. Open builder and uninstalled the existing widget
3. Tested my revision
4. Installed the new version
5. Reopened a stack that was using it

When I reopened the stack , the widget doesn't draw correctly, it just appears as a translucent square. All of the properties in the widget are cleared out. This causes errors to get thrown usually related to the missing properties.

So how do I test and update widgets that I already have installed and used?

Re: Updating a widget in use

Posted: Sun Dec 09, 2018 6:07 pm
by [-hh]
Insert step 4b: Close and restart LiveCode.

If this doesn't help make sure your OnLoad handler is downward compatible,
that is use always a keys-check:

Code: Select all

public handler OnLoad(in pP as Array)
   if <key> is among the keys of pP then
   end if
end handler
p.s. Did you think of the incompatibility of LC 8/LC 9 widgets?

Re: Updating a widget in use

Posted: Sat Dec 15, 2018 7:52 pm
by pink
okay, restarting Livecode definitely was the step I needed