Skip to content

Author: William Yu

Goodbye GTK+ 2, Hello GTK+ 3

With the release of Xojo 2017 Release 2 we have updated our Linux Desktop framework to use GTK+ 3 instead of GTK+ 2. For those not familiar with Linux, GTK+ is a User Interface (i.e. UI) toolkit, much like Cocoa is for macOS and Win32 controls (or WinForms.NET or WPF) is for Windows. GTK+ 2 has been supplying the user interface for Xojo Desktop apps for Linux since we first targeted Linux over a decade ago. It has since been deprecated in favor of GTK+ 3 for quite some time now and GTK+ 2 is typically not installed by default on most Linux distros these days, which makes deploying Xojo Desktop apps on Linux more painful. Unfortunately GTK+ 3 is not ABI compatible with GTK+ 2 so we could not migrate to using GTK+ 3 without completely ditching GTK+ 2.

Let’s take a closer look at what this means for your Linux apps:

Comments closed

Fractional Scale Factors

With all the Retina/HiDPI work done in the past few years, we’ve had to add some new features along with it. One of these newer features is the Graphics ScaleX and ScaleY properties.  For the purposes of Retina/HiDPI, the scale factor is used when converting user space coordinates to backing store coordinates.  While mostly integral on MacOS (unless originating from some code that’s probably not ours), it can vary on Windows, and perhaps arguably mostly fractional.  This is because Windows allows you to set DPI scales at 125%, 150%, etc. So when dealing with fractional scales there are a few things to watch out for:

  1. Rounding issues
  2. Anti-alias effect

While the framework takes care of rounding issues, for the most part, the secondary issue of anti-aliasing is up to you.

Comments closed

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

Take A Core Dump: What to do when your app crashes on Linux

With many things in life, more choices means more freedom of expression. We can pick and choose what we like personally as a way to express ourselves. Such is the world on Linux. The myriad of different Linux distros along with all the different Desktop managers and Window managers available are daunting. While more choices is nice (in general anyway), it can also cause more confusion. As a cross-platform developer, you’re probably aware that every operating system has their own way of dealing with crashes and crash reports.  On Linux this is no different, but it is more confusing because not every Linux distro plays by the same configuration. This blog will answer some fundamental questions you may have about what happens when your application crashes on Linux.

Comments closed

Extending Control Features on Windows

Recently an issue with our Windows MoviePlayer was brought to my attention. Specifically, it was a problem with our Looping feature when using the native player. The bug was unfortunate, but luckily there was a workaround. However, it required a less often used feature of the MoviePlayer control, the MovieController.

When we design a control, whether it’s a PushButton or MoviePlayer, we try to anticipate the most often used features and add them into our product. However, we understand that there are occasions when a certain feature is needed that we may not have exposed. For this purpose we’ve added Handle properties on almost every control. You can use this Handle property, with the right Declare, to access additional features of that control. In some cases though, at least on Windows, a bare bones Handle wouldn’t be enough. In the Windows world our Handle refers to the HWND of the control. In most cases this would be enough, however, we do have a few controls which are ActiveX based. Currently, the native HTMLViewer and MoviePlayer are one of these few ActiveX based controls.

Comments closed

The Libs Folder

For those of you building apps for Windows and Linux, you’ll notice that each build includes a Libs folder. The name of this folder depends on the application name that you’ve set in your Build Settings. For example, if my Windows App Name is “My Application.exe” then the Libs folder would be named “My Application Libs”.

Comments closed

Control Sizes On Linux

With the myriad of different Window Managers and themes on Linux, and personal preferences, you can be assured that your UI will look different from one Linux user to the next. The main challenge of being a native app is trying to normalize the UI experience across different platforms (yes, even different Linux distros).

Comments closed