REALbasic Examples

This is a website dedicated to providing examples for REALbasic. Despite being hosted at the MacCoding domain, these examples should work cross platform. The platform indicators will be used next to the download link to tell which platform they are for.

All of these examples are written by Jonathan Johnson, a tester at REAL Software. Although he works for REAL Software, these examples are kept up by him solely. Any problems with the examples should be emailed to him directly at .

All examples, unless otherwise stated in its description, work with 5.5.

Click this link to add or remove yourself to my mailing list, solely used for notifying interested people about new or updatede examples: Examples List Manager

New example from July 22, 2004:

New class from July 19, 2004:

New examples from March 27, 2004:

New examples for 5.5:

Original examples (Written for 4.5, included on REALbasic CD):

HTTPServer Example:
This is an example from my ADHOC section. It is an HTTP Server writtin in under 100 lines of code. It is fairly simple and only supports "GET", but it handles multiple connections and uses some nice Object-Oriented language features. It has no GUI at the moment.

Download

Blowfish class:
This class implements a standard encryption algorithm known as Blowfish.

Download

BigNumber Example:
The BigNumber class I wrote isn't necessarily spectacular, but it allows integer values with no fixed limit. It supports many Operators through operator overloading, so you can use bigNumberA+bigNumberB. It also shows how to use MemoryBlocks for "mutable data" (data that can change). The example is a console app, but the class works on all platforms.

Download

DialControl Example:
This is a custom canvas control showing how to subclass Canvas, mix vector and regular graphics, and a little trig as well ;)

Not Available Yet (Check back soon!)

Authorization Example:
This example shows how to, through declares, use the Mac OS X Authorization API. It also shows how to manipulate UNIX File Descriptors (FILE *) through REALbasic. The example achieves running a tool as root through the standard Authorization APIs.

Download

HexCanvas Example:
This is a custom canvas that renders data in a hex display. It's fairly speedy, but only supports viewing at the moment. However, I plan on adding editing support in the future. Ask me about it to get me working on it more quickly :P

Download

RBStyledTextPrinter:
This example is a very complex example that renders a StyledText object (does not require an editfield) into any graphics object. The example includes a class "RBStyledTextPrinter", which does the rendering, and a module "GraphicsExtension", which provides an easy way to quickly draw a StyledText object to a graphics object by saying g.drawStyledText myStyledText, x, y, [width].

This example seems to work in all of my tests, but be advised to test it yourself before including it in any product.

Download

BinaryStream:
This example demonstrates the methods of the BinaryStream class, which is used to write out binary files.

Download

Clipboard:
This example shows how to put a picture or text into the Clipboard and retrieve it as well.

Download

Contextual Menu:
This simple example shows how to use a contextual menu.

Download

CriticalSection:
This example shows how to use critical sections to control program flow when using threads.

Download

Date:
This project shows what each value of a date is, as well as how to create a new date with certain settings. Also, despite the name of the project, it will not make any dates for you -- that's still up to you ;).

Download

Dictionary:
This example shows how to use the Dictionary class. This is one of my favorite classes.

Download

Drag and Drop:
This archive contains two examples. The first shows how to create a custom drag object that contains text. The second shows how to drag rows between a listbox.

Download

Folderitem Dialogs:
This example shows how to use the FolderitemDialog classes, and display them as sheets (on OS X, but on other platforms, they still work).

Download

Folderitem:
This archive contains several examples which show many uses of folderitems. Since folderitems are very versatile classes, the examples were split up.

Download

Graphics:
This archive contains several examples, including how to double buffer, how to draw strings, how to print, and how to save pictures.

Download

GroupBox:
This example shows how the groupbox can be used to make RadioButtons become grouped and alternate between eachother automatically.

Download

Listbox:
This example shows how to use a single column listbox.

Download

MemoryBlock:
This is a simple implementation of a fast string append. Note: it isn't encoding savvy.

Download

MoviePlayer:
This example shows how to use the MoviePlayer control, as well as how to create a crossfade effect between two pictures using QuickTime.

Download

NotePlayer:
This is a fun example showing how to create some cool music using the NotePlayer. It plays the Fur Elise, as well as several other tunes.

Download

PagePanel:
This shows how to use a pagepanel.

Download

Preferences Menu:
This shows how easily the preferences menu can be added so that it moves to the correct spot on OS X, and stays put on other platforms.

Download

ProgressBar:
This example shows how to use a progressbar to not only show progress, but to put it in its barberpole state.

Download

QTEditableMovie:
This example shows how to take an animation and turn it into a movie.

Download

RegEx:
This is a simple RegEx demonstration.

Download

Screen:
This shows how to use the Screen class as well as global Screen() function to display what the current attributes of your screen are.

Download

Shell:
This shows how to execute things via the shell. Although this example is for OS X only, it can be easily adapted to Windows.

Download

Socket:
This example shows how to send data back and forth over the internet.

Download

Sound:
This example shows how to play a sound.

Download

SpriteSurface:
This example shows how to use the SpriteSurface in a simple way.

Download

StyledTextPrinter:
This example shows how to use the Styled Text Printer.

Download