Tim Dietrich

Custom Software Developer

Home Services Blog About Contact

Xojo: IDE Tips and Tricks

I've been using Xojo for well over a year now, and it is now my "go to" development tool. I've used it to create a wide range of solutions, including APIs, spiders / bots, mobile apps, and even an alternative search engine.

While I still don't feel like I'm even remotely close to being an expert in Xojo, I am certainly more comfortable with it. I've become more efficient with Xojo in general, and with the Xojo IDE in particular.

Included below are several tips and tricks that I've picked up. All of them involve the Xojo IDE. And while some of them might seem obvious to you, they certainly weren't to me.

Easily change the default property of controls.

Want to easily change the default property of a control? Simply select it and hit Return, or right-click on the object and select "Set default value..." A dialog box will appear in which you can make the adjustment.

This has been a big time saver for me, because prior to stumbling upon this, I used to pull up the Inspector every time that I needed to make even the simplest of changes to a control. For example, to change the text for a label, the caption for a button, and so on.

Toggle between portrait and landscape mode in iOS projects.

Working on an iOS project and want to quickly see how a view will look when it's in portrait or landscape mode? Hold down the Command key and press the left or right arrow keys to toggle between portrait and landscape mode. There are also buttons in the toolbar that you can use to switch display modes. This saves you from having to run the app in the Simulator.

Use an alternative device in the Editor.

By default, the Xojo editor window displays an iOS app's views as if they were running on an iPhone 4. You can change the device by clicking on the Device Type icon, which is located in the toolbar. There you can select from one of several iPhones (4, 5, 6, or 6 Plus) or iPad.

Work in multiple tabs.

It took me awhile before I fully appreciated being able to work in multiple tabs. That's probably because when I started using Xojo, I was fumbling around while trying to understand things. In any case, think of tabs as different workspaces that let you focus on different aspects of your app at the same time. For example, in one tab, you might be working on a view. In another, you might be working on the specifics of a custom class.

To open a new tab, press Command-T, or select File > New Tab.

Lock control positions.

It's frustrating to have all of the controls positioned correctly on a view, only to realize that at some point you accidentally "whacked" something's position. You can prevent this by locking a control's position. To do so, right-click on a control and select Lock Position.

Change the appearance of controls Library.

This is another tip that was helpful when I was starting out and I wasn't familiar with all of the controls that are available. By default, controls are displayed in the Library with just their large icons. You can change their appearance, as well as how they're sorted and grouped, by clicking on the gear icon in the Library. I find that the "Small Icons and Labels" view works best for me.

Easily access an object's properties and methods.

Xojo's ability to auto-complete code is very helpful. However, there are times when I have no idea what property or method an object supports, or when I do know what I'm looking for and can't remember its name. However, Xojo can help. If you have an object's name typed in the editor, followed by a period, you can hit Tab to reveal a convenient list of the object's properties and methods. This has been an incredible time saver for me.

Quickly comment / uncomment code.

There are often times when you want to comment (or uncomment) out a block of code. Xojo makes that insanely easy. Just highlight a block of text (or a single line) and press Command-' (a single quote) to toggle commenting.

Get quick-help for a class, property, or method.

To quickly view documentation for a class/object, property, or method, highlight it, then right-click, and select the "Help for..." option. The Xojo Language Reference will open up and go directly to the appropriate documentation.

Attach notes to an object.

You can easily add notes to most top-level objects, such as Screens, Views, and even the App itself. This is a very convenient way to document your project.