App Structure

From Xojo Documentation

Every project has an App object that is automatically added to it when the project is created. This App object gives you access to events and properties that are specific to the app type. If you look at the Inspector for the App object, you'll see that it has a super which varies by project type:

Project Type Application Class
Desktop Application
Web WebApplication
iOS iOSApplication
Console ConsoleApplication

Accessing the App object

You can set the scope of properties, methods and constants of the App subclass using the same rules as for any class.

The global App function gives you a reference to the App class in your project so that you can access its public properties, methods and constants.

To access a public property somewhere in your project, you would write it like this:

value = App.MyProperty

You can rename the App object to give it a more descriptive name. If you do, you still use the App function to get access to it.

If you wish, you can even subclass App. When you do this on a desktop project, your new subclass gets the properties for the default window, menu bar and icon. If you have subclassed App, the App function gives you a reference to the subclass instead.

You use the App function to get a reference to the App object even if you have renamed or subclassed the App object.

See Also

UserGuide:Desktop Apps, UserGuide:Web Apps, UserGuide:Console Apps, UserGuide:iOS Apps topics