Skip to content

Author: William Yu

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

The Real Reason Behind the Canvas/ContainerControl Transparent Property

When we added this property to the Canvas and ContainerControl there was probably a lot of head scratching going on. Some of you probably asked yourself (or us) “Why is this necessary?” or “Isn’t this pretty much the same thing as enabling DoubleBuffer?”

Well, yes to the latter question on Windows, and a slightly more optimized experience on OS X, but the impetus behind this property was really our redesigned IDE. More specifically, it was a need/requirement because of a long standing issue with our Linux framework.

Comments closed

Writing High-DPI Aware Windows Apps

Today’s laptops and monitors support high resolution displays which allow you to pack more information and content on the screen. Although one common complaint is that people find the text to be too small at the maximum resolution, Windows’ solution to this is the ability for the user to adjust the DPI setting.

SetDPI.png

Comments closed

Linux and Overlay Scrollbars

Linux, especially Ubuntu, has quickly evolved, introducing core UI changes such as the global menu bar (akin to OS X’s single menubar system) as well as Overlay Scrollbars. Overlay Scrollbars were meant to reduce the amount of clutter needed around content areas by showing up only when hovered over, and always outside the content area. If you’re developing any kind of serious application on Linux, especially if you are targeting Ubuntu, you want to be able to detect whether or not the system supports Overlay Scrollbars.

Overlay1.png

Comments closed