Skip to content

Category: Windows

Posts related to Windows-specific development.

Windows App Requirements

Microsoft refactored their core app runtimes in 2015. They have made what they call a “Universal C Runtime” which has been distributed via Windows Update to all supported versions of Windows that stay up-to-date (which is the default behavior for Windows Update).

Starting with Xojo 2016r1, the Xojo Windows framework has been updated to use the latest Microsoft tools. This allows Xojo to stay up to date and allows the Windows support to be improved in future releases. This means that Xojo itself now uses the new Universal Runtime and your built apps now require it.

Comments closed

WeakRef and Memory Management

Object Oriented Programming with Xojo, and in this case Event Oriented Programming as well, is simply wonderful. You create objects (Instances) from the defined classes that act as templates and just let them roll. From there, the interactions made by the user are those that determine how objects interact with each other via sending messages to each other (method calls), the access to properties and also the execution of events.

However, sometimes the combination can simply reach unstable situations by the very nature of our applications and here is where failures can arise in memory management. Fortunately, we can keep this under control with the help of the WeakRef class.

Comments closed

Xojo Programming Language: 6 Fascinating Facts

Xojo is similar to VB, Java and C#

The Xojo programming language is fully object-oriented and uses an object model that is quite similar to VB, Java and C#. If you are used those languages at all, you’ll be right at home with Xojo.

Available since 1998, Xojo was one of the first languages to use Automatic Reference Counting (ARC), something that other languages such as Swift and Objective-C now use. Xojo is type-safe and fully object-oriented making it easy to learn and use, but it also has advanced features such as namespaces, extension methods, exception handling, introspection, delegates and more.

Comments closed

Advanced Retina/HiDPI: BitmapForCaching and ScaleFactorChanged

The most direct way to support HiDPI* for custom controls is to draw into the Graphics object passed into the Paint event. That graphics object is already configured with the appropriate scale factor and double buffering- the entire control will be handled correctly by the framework if the DoubleBuffer property is set.

*As with other posts, we’ll use “HiDPI” to refer to both HiDPI on Windows and Retina on OS X.

2 Comments

Xojo Retina/HiDPI: The journey of a thousand pixels…

“Retina” is the name for high resolution screens on Mac and iOS devices while “HiDPI” is the Windows equivalent. For simplicity, I’ll use HiDPI (which really is the universal technical term) for the rest of this blog post. Now that we have HiDPI support in Xojo, if you app doesn’t use any pictures, you can simply open your project, click on Shared under Build Settings and turn on the “Supports Retina/HiDPI” option. That’s all you need to do to have a HiDPI version of your app!

Having said that, if you are creating or using pictures in your project, there may be a few adjustments you’ll need to make to your code. A little over a year ago the process of making sure we had all of the necessary graphics together to build a Retina/HiDPI IDE was added to my to-do list. While 95% of the icons created for the Xojo IDE in 2013 already existed, most of the graphics that made up the IDE itself did not, and the IDE itself needed a bit of an overhaul to get it ready for the big change, both in graphics and in code…

2 Comments

How to Recursively Delete a Folder

While Xojo doesn’t currently provide a direct way of recursively deleting a folder, there are various options that will allow you to do this:

1. Recursively iterate through all the folders, deleting each one. You can read about that at our Developer Site, this is the best cross-platform way.
2. Use the Shell to recursively delete a folder (i.e. “del /s” on Windows, or “rm -rf” on OS X and Linux)

Windows specific ways:
3. SHFileOperation (an older API)
4. IFileOperation (the more modern API that Windows recommends over option #3)

I’ve decided to look at option #4, since this allows more customized options, like the ability to show a progress dialog. However, it is also the slightly more complicated option since it deals with COM & Delegates. The example illustrates this:

Comments closed