Updating a class package

I am using a number of classes in a project that are provided by third parties eg StackView, Graffiti Suite desktop etc. How do I update these in the project without losing all the work I have done, do I just overwrite the classes for each of the supplied parts and Xojo magically sorts it out or do I need to do something else.

Thanks

when you say “all the work I have done” are you referring to changes you made to those original packages source code ?

No, I am talking about the canvas controls etc that are part of the classes that I have added to container controls, windows etc.

make sure you have a backup copy of your project (or even better have it in a version control system)

if you just drag the new copies in they wont replace the existing ones
they’ll end up being named with a trailing digit
and the existing uses of the original classes wont suddenly use the new ones

if you delete the originals and put the new classes in then you may be good to go
EXCEPT (and this is why I said make sure you have a back copy etc JUST IN CASE) when you remove the originals the instances on various layouts may reset some properties and I am not 100% sure IF when you add the new copies all of those properties will be preserved

Oh ok, how do other people do this when they update classes etc when new versions are released. Am I doing something wrong in the way I am using the classes etc or is this a known issue?

Concerning the StackView classes I can tell you that you only have to delete the old StackView folder from the project and insert the one of the new version.

I never touch the SourceCode of Controls still supported by the Developer and create my own Subclasses from them, in which i work.

Then if an update comes in, i remove the outdated Controls from the Project (in the Navigator, not the Folders/Files(!)) and (this one is important) i instantly insert the new Controls. Do NOT enter any area of your Project as long as you did not reinsert the Controls again, or your Containers, Windows, … with such Controls will “break”. At least, this is my experience with Control Updates.

Thanks that’s good to know :slight_smile:

[quote=439948:@Sascha S]I never touch the SourceCode of Controls still supported by the Developer and create my own Subclasses from them, in which i work.

Then if an update comes in, i remove the outdated Controls from the Project (in the Navigator, not the Folders/Files(!)) and (this one is important) i instantly insert the new Controls. Do NOT enter any area of your Project as long as you did not reinsert the Controls again, or your Containers, Windows, … with such Controls will “break”. At least, this is my experience with Control Updates.[/quote]
Ok that is really helpful as well, thanks.

For future reference, these steps are best when performing in-place upgrades of third-party classes. As Sascha said, if you’re on a view where one of the effected classes is used, you can bork the instance. There have been other gotchas in the past, which is why I list so many steps. Better safe than sorry.