Skip to content

Category: Technology

Design Patterns in Xojo: Observer, Part 1

In a previous post we saw how to implement the Singleton Design Pattern in our Xojo apps. Now, it is time to look at another useful Design Pattern you can use in your apps: the Observer Design Pattern. This one solves the kind of question “How can the ‘x’ controls be automatically notified every time there are changes on ‘y’?” Sound interesting? Let’s see how!

Faro.jpg

In fact, this is the first of a two part series regarding the Observer Design Pattern. This one will focus on how easy is to implement using the interfaces already available in Xojo for UI controls like the PushButton, the BevelButton, and also for the Timer class. In Part 2, we will see how to implement the Observer Design Pattern from scratch, using our own Classes and Interfaces, so it will be easier to understand the mechanisms behind this Pattern and how to use it.

Comments closed

Design Patterns in Xojo: Singleton

One of the best things that Xojo offers to programming newcomers is that they can simply jump-in and start to write code. In a matter of a few hours they’ll have a functional app! Nothing new here. (Or for not-so-newcomers, a fast way of creating a functional prototype from a idea).

CandyMachine.pngBut as these users advance in their Xojo skills, they probably will care about coding better and to embrace the OOP way of doing things. After all, Xojo is a modern programming language with Classes, Inheritance, Interfaces and a bunch of the usual OOP paradigms that have much to offer: reusability, better maintainability and a lot of flexibility.

Comments closed

Methods Overloading: Computed Properties, Setters and Getters

Some years ago, Xojo introduced the ability to use Computed Properties, something that is present in other programming languages too and is based on the use of dedicated methods to assign and retrieve the property value itself. So, in other programming languages, the first of these dedicated methods (or functions), the Setter, is the one invoked every time we want to modify the value of the associated property, while the Getter method is the one used from our code to retrieve the associated value. The Object-Oriented Programming (OOP) concept found behind this feature is Method Overloading. Nevertheless, let’s make clear that Xojo Computed Properties are not methods. They aren’t! But they make our life as developers much easier compared with regular Properties.

Comments closed

The Chinook Sample Database

Have you ever needed or wanted a populated sample database with several related tables to play around with? Perhaps you are learning about databases and database design or perhaps you want to try out a new tool such as Xojo but want a pre-build database to start with.

Comments closed

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

Headless Pi: Using Xojo and Raspberry Pi Without a Display

You don’t need to hook up your Pi to a physical display, keyboard and mouse. You can set up VNC on the Pi so you can remotely connect to it.

My Raspberry Pi 2 sits on my desk next to one of my speakers. It’s not hooked up to any display. I use a combination of SSH, SFTP and VNC when I need to work with it.

Comments closed

Raspberry Pi 3 Announced!

On Monday February 29th, the Raspberry Pi Foundation announced the new Raspberry Pi 3. This updated Pi has some significant improvements over the Pi 2, including:

  • A 1.2GHz 64-bit quad-core ARM Cortex-A53 CPU (~10x the performance of Raspberry Pi 1)
  • Integrated 802.11n wireless LAN and Bluetooth 4.1
  • Complete compatibility with Raspberry Pi 1 and 2

That last bullet point is notable because it means that Xojo is also fully compatible with the new Raspberry Pi 3!

Comments closed