Encapsulate G4P app?

I have a small App that has been partially built using The G4P gui builder tool
This is to be a helper app in the context of a much larger app .
It is simply a calculator that takes a number from the main app, manipulates it and then returns the result
It would be really convenient if this code could be encapsulated in some way
so that it doesn’t have to reside in the same sketch as the main code.
(whatever the rough equivalent of C++ #include is).

Or maybe put it in a class (but then what about all that autogenerated code that must not be touched ?)

Alternatively are there general best practices for keeping a project under control when it ends up with quite a number of self contained components that all interact with each other to some degree.


1 Like

When using GUI Builder the code in the gui tab is regenerated every time you move from the design window( GUI Builder window) to the sketch window, over-writing whats already there. Once you have created the gui and you no longer need to use GUI Builder you can do anything like with the code, even move it to another tab.