Updating a widget in use

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
pink
Posts: 272
Joined: Wed Mar 12, 2014 6:18 pm

Updating a widget in use

Post by pink » Sun Dec 09, 2018 11:52 am

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?
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Updating a widget in use

Post by [-hh] » Sun Dec 09, 2018 6:07 pm

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?
shiftLock happens

pink
Posts: 272
Joined: Wed Mar 12, 2014 6:18 pm

Re: Updating a widget in use

Post by pink » Sat Dec 15, 2018 7:52 pm

okay, restarting Livecode definitely was the step I needed
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

Post Reply

Return to “LiveCode Builder”