Winterthur Xojo Meeting

The Xojo meeting in Winterthur (Swiss) will take place twice.

Monday, 13rd October 2014
Saturday, 18th October 2014

We meet at about 7pm in a restaurant. If you are interested, please contact me. (Free entry)
Extract location will be emailed later.

Other meetings:
Hamburg: 1st October 2014
Den Haag: 8th October 2014

Tip of the day: Print to PDF with OpenPrinter in Xojo

This little example code shows how to redirect printing to a PDF file in Xojo and still use the built in Xojo print commands via graphics class:
// get Xojo printer setup dim p as new PrinterSetup // now put it into NSPrintInfo to manipulate dim n as new NSPrintInfoMBS n.SetupString = p.SetupString // change destination to file dim f as FolderItem = SpecialFolder.Desktop.Child("test.pdf") n.SetSaveDestination(f) // move back p.SetupString = n.SetupString // and print as usual dim g as Graphics = OpenPrinter(p) g.DrawString "Hello World", 20, 20

Macoun Article

At the Macoun I made some notes and wrote an article about the conference.

You can read it on the Mac & i website:

The event was great and a big family meeting of the Mac and iOS developer community in German speaking countries.

Greetings from Macoun

The Macoun conference is one of the biggest Mac and iOS developer conference with over 400 participants.

22 sessions about coding topics, well, it feels like a smaller WWDC in German. :-)
Currently I enjoy another session about Swift.

Check the website:

Xojo Cloud Data Centers

Do you use Xojo Cloud?
Well, it's a convenient way to host Xojo apps:
  • For a space for yourself to test web apps
  • To host web apps you want to present to a client
  • To get a server for client to host their app you wrote.
While you can setup yourself a virtual private server with some configuration work, for a lot of Xojo developers it's certainly more convenient to buy the xojo cloud server and deploy there. Let someone else install Linux updates and keep an eye on intruders and security.

And now they added more data centers:
  • Chicago
  • London
  • Hong Kong
  • Sydney
see Announcement on Xojo website

Sending email via SMTP using CURL

If you have trouble sending email via CURL functions, how about trying those options:
  • OptionUpload on
  • OptionVerbose on
  • OptionPort 587
  • OptionFTPSSL all
  • OptionURL smtp://server
This way, we get right port, use SSL, but with TLS upgrade on a normal smtp URL. Using SMTPS URL fails as it starts a SSL connection right away. For some server this fails as they need a normal SMTP start and later an upgrade to SSL.

PS: This way you can send email via MBS Plugin in both FileMaker and Xojo over Office 360 smtp servers from Microsoft.

MBS Xojo / Real Studio Plugins, version 14.4pr2

New in this prerelease of the 14.4 plugins:
  • Added CoreWLAN keychain utility functions to CWGlobalsMBS module.
  • Added CGDisplayMBS.DisplayProductNames function.
  • Added UDPSocketMBS.ReusePort property.
Download: Or ask us to be added to our shared Dropbox folder.

EasyTCPSocket Packet format

Recently we had need to write a counter part in another development tool for EasyTCPSocket, so here is the format description of the packets:
  • Packet starts with 4 byte length as Integer, big endian
  • Followed by 4 byte command code as integer (big endian)
  • Followed by the actual packet data
With this information, everyone can write a counter part and maybe someone from Xojo wants to officially confirm that and document it.

Xojo Meetings in Europe

We are organizing some Xojo meetings in October and if you are interested, please join survey or contact me:
  • Den Haag (Netherlands), date is Wednesday, 8th October in VJ Scheveningen/Den Haag. Like to join? Please email me.
  • Toulouse (France), survey still running
  • Winterthur (Swiss), survey still running
  • Hamburg (Germany), date is Wednesday, 1st October in Hamburg. Like to join? Please email me.

MBS Xojo / Real Studio Plugins, version 14.4pr1

New in this prerelease of the 14.4 plugins:
  • Updated DynaPDF to version
  • Fixed problem with memory management which caused issue with overwritten memory in CURLSMBS.OutputData property.
  • Added placeholderAttributedString and placeholderString to NSTextFieldMBS class.
  • Changed JSONMBS to add items to object/array by reference if they belong to other tree.
  • Changed TimerMBS to no longer be reentrant if something yields time in action event of timer.
Download: Or ask us to be added to our shared Dropbox folder.

Three more Plugin parts sold separately

Due to recent requests, I put three more plugins part for individual purchase on the store.

Linux, AVFoundation and Lion.

While Linux plugin can be used alone, the other two plugins have references to Cocoa plugin. So in order to use them and have projects compile you need to install the required plugins (Cocoa, CocoaBase, Leopard, MacOSXCG and MacOSXCF).

With Lion plugin alone you can of course just use the new Mac App Store receipt classes. For AVFoundation plugin you can only use a few limited features without other plugins, like opening a video and reading meta data.

MBS Xojo Developer Conference starts soon

Tomorrow our training day starts and in evening we meet in beer garden (see picture) and you are welcome to join!
Later we go for dinner in the hotel restaurant.

If you like to attend, please register soon. We already have participants from 11 countries.

Xojo developers coming for a visit for dinner are welcome.
If you like to come Thursday, please contact me so you can join our dinner event.

[ANN] MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 14.3

NICKENICH, Germany (September 16th, 2014) -- Monkeybread Software releases version 14.3 of the MBS plug-in for Xojo and Real Studio.

The MBS plug-in comprises a collection of several plug-in parts which extend the Xojo (Real Studio) development environment with 2,100 classes featuring over 53,000 documented functions. Our plugins support all three platforms Mac OS X, Windows and Linux with all project types desktop, web and console.

Some of the highlights on the 14.3 update:

For applications in the Mac App Store, we have the StoreKit functions to handle in-app purchases. With the new plugin we add classes to read details from the app store receipt and check which in-app purchases have been purchased. Our plugin can also verify if the receipt is valid.

Our CURL Plugin can send and receive emails for years now via IMAP, Pop3 and SMTP. With the new plugin class CURLEmailMBS we make it easier to build the emails for sending. So you can assemble an email with HTML, plain and rich text parts, attachments and various addresses and send it via SMTP server through CURL classes.

For Mac we implemented the Image Capture classes and various views. So you can show the same user interface as Apple's applications. There is a device selector view, a scanner and a camera view. You can access devices like scanners and cameras, browse, import or scan images.

Our new TimerMBS class provides a high resolution cross platform timer. While Xojo's built in timer only fires 60 times per second on Windows, our timer can run a quick as 1000 times per second.

The new UDP Socket class in our plugins provides some more low level options for UDP. For example you can reuse addresses for multicast.

For printing we got improvements for both Mac and Windows. The NSPrintInfoMBS class can now be used to modify PrinterSetup.SetupString to enable different options like duplex printing or switch printers. Similar things can be done on Windows using the WindowsDeviceModeMBS class using new functions.

Our SQL Plugin now supports better using SSL with MySQL. The new ConnectionHandler events allow you to specify extra options for connecting. The SQLDatabaseMBS class now raises exceptions if you call unsupported functions. This avoids trouble for unintended calls.

This update includes a lot of little improvements like get/set RTF data on a TextArea on Windows using native methods which is more efficient. We already have similar functions for Mac, so you can avoid using StyledText class methods. Our WinThumbnailMBS function provides preview images of supported file types on Windows.

With this update, we also provide updated libraries like zint, PortAudio, OpenSSL 1.0.1i, CURL 7.37.1, DynaPDF, LCMS 2.6 and LibXL 3.6.0.

See release notes for a complete list of changes.

Xojo Meeting in Hamburg, Germany

Interested in a Xojo meeting in Hamburg?
I'll be there in two weeks and would like to offer a dinner meeting.

Which date would you prefer?
30th September, 1st to 3rd October?

Survey to find date

MBS Xojo / Real Studio Plugins, version 14.3pr11

New in this prerelease of the 14.3 plugins:
  • Changed PictureMBS constructor so you can pass nil for temp folderitem for mac and linux and get an automatically temp file.
  • Added UDPSocketMBS class.
  • Updated DynaPDF to version
  • Added CGBitmapContextMBS.Create function which takes existing bitmap to make new object with different color space.
  • Fixed bug in CombineTiff8BitCMYKtoTiffMBS.
  • Changed PictureMBS.Constructor to no longer use 64 KB blocks on Windows. Now using 4 KB blocks which makes smaller temporary files.
  • Fixed bug with AddAttachment with CURLEmailMBS class.
Download: Or ask us to be added to our shared Dropbox folder.

Tip of the day: Double comparison

Just run into the problem this week that double comparison often works, but also fails unexpected in an application. This remembers again to use comparison with tolerance for double variables. Like here with abs() and a 0.01 tolerance:

dim d as Double = 10 dim e as Double = 1.19 dim f as Double = d * e // checking exact fails if 11.90 = f then Break else Break end if // better check with tolerance if abs(11.90-f) < 0.01 then Break else Break end if

Tip of the day: Start your Mac with pressed Shift Key

Just a little thing you can do every few months:
Press Shift key to start your Mac in safe mode. Than restart to get back to normal.
When doing that Mac OS X will do some cleanup and empty some folders with temporary files apps forgot to delete.
Freed 2 GB for me today :-)

MBS Xojo / Real Studio Plugins, version 14.3pr10

New in this prerelease of the 14.3 plugins:
  • Rewrote DynaPDFMBS.RenderPagePicture function.
  • Added CURLEmailMBS class.
  • Added AUPlayerMBS.MaximumFramesPerSlice property.
  • Added FromSetupString and SetupString methods to WindowsDeviceModeMBS class.
  • Added parameters for WindowsDeviceModeMBS to read/write DEVMODE in either ANSI oder Unicode.
  • Added NSPrintInfoMBS.SetupString compatible to PrinterSetup.SetupString.
  • Added PDFDocumentMBS.PrintOperation.
  • Improved NSPrintInfoMBS class to have more debugger visible properties.
  • Added NSAppearanceMBS class.
  • Changed a lot of properties in NSWindowMBS to make them visible in debugger.
  • Added NSToolbarMBS.configurationDictionaryData.
  • Added raster support for Cairo style picture objects in Linux desktop.
  • Fixed some bugs with AppReceiptMBS class.
  • Added SQLCommandMBS.isExecuting property.
Download: Or ask us to be added to our shared Dropbox folder.

PS: In newer plugins, the WindowsTimerMBS class got renamed to TimerMBS.

Updating PrinterSetup.SetupString on Windows

Same as for Mac is also possible on Windows:

dim p as new PrinterSetup // setup something call p.PageSetupDialog // now we have nice setupstring dim ss as string = p.SetupString // parse it in device mode dim d as WindowsDeviceModeMBS = WindowsDeviceModeMBS.FromSetupString(ss) // duplex is? MsgBox "Duplex: "+str(d.Duplex) // change printer d.DeviceName = "Deskjet 2540 series#:2" // enable duplex d.Fields = BitwiseOr(d.Fields, d.DM_DUPLEX) d.Duplex = d.DMDUP_HORIZONTAL // now duplex is? MsgBox "Duplex: "+str(d.Duplex) // get back as setup string dim da as string = d.SetupString if da = "" then MsgBox "failed to create setup string" Return end if // assign back p.SetupString = da // take a look call p.PageSetupDialog // and print something dim g as Graphics = OpenPrinter(p) g.DrawString "Page 1", 20, 20 g.NextPage g.DrawString "Page 2", 20, 20
So next plugins may help you if you need to modify printer setup strings on Mac and Windows.

Updating PrinterSetup.SetupString on Mac OS X

With next plugins, we can use new NSPrintInfoMBS methods to directly convert SetupString from PrinterSetup class into NSPrintInfoMBS object. So we can change paper format, printer selection and a couple of other properties:

// start with a printer setup dim p as new PrinterSetup // clone to NSPrintInfo dim info as new NSPrintInfoMBS(p.SetupString) // find out what name second printer has dim printers() as string = NSPrinterMBS.printerNames dim printer as NSPrinterMBS = NSPrinterMBS.printerWithName(printers(1)) // now set a new paper size and this printer info.paperSize = new NSSizeMBS(72*5, 72*6) // 5 by 6 inch info.printer = printer // and clone back p.SetupString = info.SetupString // now print to this printer with this paper dim g as Graphics = OpenPrinter(p) g.DrawString "Hello", 10, 10
As you see we can use modified setup string for using normal Xojo printing functions!

PDF printing via PDFKit

With next plugin prerelease, you can print PDF using PDFKit directly in Xojo:
// select a PDF dim f as FolderItem = GetOpenFolderItem("") if f = nil then Return // open PDF dim doc as new PDFDocumentMBS(f) // define some print setting via PrintInfo dim PrintInfo as new NSPrintInfoMBS // start print operation dim printOperation as NSPrintOperationMBS = doc.PrintOperation(printinfo) // set options on operation printOperation.showsPrintPanel = true printOperation.showsProgressPanel = true // and run it call printOperation.runOperation
That is same command as we use for PDFKit.Print in our FileMaker plugin.

Registration Now Open for XDC 2015

Registration is now open for the 2015 Xojo Developer Conference (XDC), taking place in Austin, Texas April 29 - May 1, 2015 at the Radisson Hotel. XDC includes over 30 technical sessions presented by the company's development staff and leading users from around the globe. In addition, XDC will include a keynote address from Founder and CEO Geoff Perlman, numerous opportunities for attendees to interface with the Xojo engineers themselves, networking events with other Xojo users from the international community, and a new and exciting gaming code battle.

XDC features sessions on best practices, special interests and other technical issues, with content for every level of Xojo developer - from newcomers and students to advanced sessions for Xojo experts and professionals. With the introduction of the iOS platform in 2014, Xojo engineers will cover sessions at XDC on iOS development and best practices.

Conference pricing:

Early Registration Price, Ending 11/30/2014: $749
Advanced Registration Price, 12/1/2014 - 2/1/2015: $899
Advanced Registration Price, 12/1/2014 - 2/1/2015: $899

The Radisson Hotel is offering XDC attendees a special hotel room rate of $169/night during the conference. For more information, please visit: or register now!

MBS Xojo Developer Conference in two weeks

Just two weeks left until the conference starts. If you like to attend, please register soon. We already have participants from 10 countries and the hotel will soon run out of available rooms.

On the weekend of conference, there is the

3 Tage Stadtfest. Musik und Unterhaltung auf 6 Bühnen. Kunsthandwerkermarkt, Mittelalterspektakel, Burgunderfest, Autoschauen und Weinfest.

3 days city festival, Music and Entertainment on 6 stages. Artisans market, Middle Ages spectacle, Burgundy wine festival, car presentation and wine festival.

17th - Xojo Training in German
18th and 19th - MBS Xojo Conference in English
20th - Xojo Training in English

MBS Xojo / Real Studio Plugins, version 14.3pr9

New in this prerelease of the 14.3 plugins:
  • Updated CURL to version 7.37.1
  • Added DynaDFFontInfoMBS class.
  • Updated DynaPDF to version
  • Added CurrencyValueMBS function to replace val() for parsing big numbers into currency data type.
  • Rewrote EncodingToQuotedPrintableMBS and DecodingFromQuotedPrintableMBS.
  • Changes to NSApplicationDelegateMBS require that you initialize your delegate subclass in app.constructor to receive the restoreWindowWithIdentifier events later.
Download: Or ask us to be added to our shared Dropbox folder.

PS: In newer plugins, the WindowsTimerMBS class got renamed to TimerMBS.

You make backups?

On monday I wondered why my Time Machines stopped doing backups. Preparing took forever. Later that day I got messages from my scripts for building plugins about NilObjectExceptions. Turned out that operations like creating folders or creating binarystreams failed for virtual volumes. Later in evening the Finder started complaining that disk is full when copying files. VMWare stopped to launch as it could not write file for virtual memory. SMART analysis of my disk gave no errors, so I presumed a failure in the internal data structures for managing blocks.

Well, a SSD is a dream in speed, but when management fails on various levels, there is not much to repair like a good old hard disk with real disks.

I do have backups: Online backup (so I can backup at client office, in hotel, etc.), Time Machine (Apple's backup software) with several Time Capsules in various places and an external bootable USB disk for cloning. So I updated my clone with last changes, formatted my internal SSD and cloned things back. Now everything is right and not a single file is lost.

If the clone is not an option, e.g. outdated, I would have used time capsule to restore last backup and use my online backup to get the changed files from the last 2 days.

What do you do for backup?

If you are interested in online backups and you want to use your own webspace or your own S3 account (Without an intermediate company between), you can use Arq from Haystack Software. It's a nice app to run in background and upload changed files. I'm using it now for over 2 years. Any I often see myself restoring files using Arq instead of Time Machine due the easier to use browsing.

If you like to order a copy, you can use this coupon code for 10% off: U17ITZRZL4UPIVBK (expires September 30, 2014).

I'm not affiliated with Haystack Software and just an user enjoying this software.

xDev Magazine Issue 12.5

The September/October 2014 (12.45 issue of xDev Magazine is now available.
Here's a quick preview of what's inside:

* In-App Notifications * by Sam Rowlands
Using a timer to update user-interfaces is a good idea. But Sam's got a better one: ager! borrowing from a Obj-C technique, he's created an in-app notification system so your objects can talk to each other and be notified when they need to be updated.

* Writing Apps for Game Center: Part 2 * by Tom Baumgartner
In Part 2, Tom explains how to request a match in real-time games.

* Inside HandleSpecialURL * by Christian Schmitz
Web Edition provides a full web server that can handle custom URLs via the HandleSpecialURL event. Christian demonstrates how to use this to create your own REST-like API.

* Yosemite Ready? * by Sam Rowlands
Mac OS X Yosemite is coming this fall. Are you ready for it? Sam provides some tips and techniques to get your Xojo app ready now.

Plus columns on object-oriented programming (SimpleDraw demo app), coding styles, database design, Xojo tips, meet a Xojo game developer, Regex conditionals, and much more.

Currency Data Type

Xojo features a data type called currency. It is used for storing currency values and uses internally a 64bit value. As 4 digits are reserved for right of the dot, the 1.0 value is stored internally as 10000. When converting between double and integer, values are divided/multiplied by 10000.

There is a problem:
Double values are only precise for 15 digits, so having a big value like 123456789012345.1234 in a currency will not work correctly, as this can't be stored in a double. You get 123456789012345.1136. There are rounding issues.

But some of use need to work with huge numbers and functions like val() internally use double, so there are rounding issues with parsing.

For next plugin we'll add a function CurrencyValueMBS to fix that. Our CurrencyValueMBS function will return currency values parsed up to "+922337203685477.5807" just fine. If value is out of range, we raise an exception, so you can track down errors.

MBS Xojo / Real Studio Plugins, version 14.3pr8

New in this prerelease of the 14.3 plugins:
  • Fixed JPEGExporterMBS.ExportRGBwithRowDataEvent to write out ICC Profile data (was missing).
  • Fixed AVFoundationMBS.PeriodicTimeObserver event to pass parameters right.
  • Fixed Win plugin to load again on Realbasic 2009.
  • Changed Mac linking to create dylibs instead of bundle dylibs.
  • Added AppReceiptVerificatorMBS, AppReceiptMBS and AppReceiptIAPMBS classes.
  • Added SystemInformationMBS.IsYosemite.
  • Added webview parameter to WebFrameLoadDelegateMBS events.
  • Improved PDFPageMBS and PDFDocumentMBS classes to show more details in debugger.
  • Renamed WindowsTimerMBS to TimerMBS as we got a Mac and Linux implementation for your cross-platform projects.
Download: Or ask us to be added to our shared Dropbox folder.

PS: In newer plugins, the WindowsTimerMBS class got renamed to TimerMBS.

ICC color profiling

We recently got an example about color matching a JPEG file and I want to share this with you.

This code takes a JPEG file, reads it into memory. We pick the ICC profile from the JPEG file. If that is empty, we will substitute it with a generic SRGB profile. For the output profile, you pass it as folderitem to this method, so we need to read it to memory (for embedding later) and also open the profile for doing the color transformation. Now we can create two bitmaps, one for input, one for output. Input bitmap references directly our picture object and output creates a new bitmap with matching size and RGB color space. We create a color transformation with LCMS 2 and process the bitmaps. Now we query the picture and export it with the output profile to disk.

This is the simple version. Included with next plugins is the example project and it includes also an advanced version which uses memory blocks instead of picture object and works with CMYK, Gray and RGB input JPEG files.

Here the code of the method: (more)
The biggest plugin in space...


Apr 2024
Mar 2024
Feb 2024
Jan 2024
Dec 2023
Nov 2023
Oct 2023
Sep 2023
Aug 2023
Jul 2023
Jun 2023
May 2023
Apr 2023
Mar 2023
Feb 2023
Jan 2023
Dec 2022
Nov 2022
Oct 2022
Sep 2022
Aug 2022
Jul 2022
Jun 2022
May 2022
Apr 2022
Mar 2022
Feb 2022
Jan 2022
Dec 2021
Nov 2021
Oct 2021
Sep 2021
Aug 2021
Jul 2021
Jun 2021
May 2021
Apr 2021
Mar 2021
Feb 2021
Jan 2021
Dec 2020
Nov 2020
Oct 2020
Sep 2020
Aug 2020
Jul 2020
Jun 2020
May 2020
Apr 2020
Mar 2020
Feb 2020
Jan 2020
Dec 2019
Nov 2019
Oct 2019
Sep 2019
Aug 2019
Jul 2019
Jun 2019
May 2019
Apr 2019
Mar 2019
Feb 2019
Jan 2019
Dec 2018
Nov 2018
Oct 2018
Sep 2018
Aug 2018
Jul 2018
Jun 2018
May 2018
Apr 2018
Mar 2018
Feb 2018
Jan 2018
Dec 2017
Nov 2017
Oct 2017
Sep 2017
Aug 2017
Jul 2017
Jun 2017
May 2017
Apr 2017
Mar 2017
Feb 2017
Jan 2017
Dec 2016
Nov 2016
Oct 2016
Sep 2016
Aug 2016
Jul 2016
Jun 2016
May 2016
Apr 2016
Mar 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
Jun 2015
May 2015
Apr 2015
Mar 2015
Feb 2015
Jan 2015
Dec 2014
Nov 2014
Oct 2014
Sep 2014
Aug 2014
Jul 2014
Jun 2014
May 2014
Apr 2014
Mar 2014
Feb 2014
Jan 2014
Dec 2013
Nov 2013
Oct 2013
Sep 2013
Aug 2013
Jul 2013
Jun 2013
May 2013
Apr 2013
Mar 2013
Feb 2013
Jan 2013
Dec 2012
Nov 2012
Oct 2012
Sep 2012
Aug 2012
Jul 2012
Jun 2012
May 2012
Apr 2012
Mar 2012
Feb 2012
Jan 2012
Dec 2011
Nov 2011
Oct 2011
Sep 2011
Aug 2011
Jul 2011
Jun 2011
May 2011
Apr 2011
Mar 2011
Feb 2011
Jan 2011
Dec 2010
Nov 2010
Oct 2010
Sep 2010
Aug 2010
Jul 2010
Jun 2010
May 2010
Apr 2010
Mar 2010
Feb 2010
Jan 2010
Dec 2009
Nov 2009
Oct 2009
Sep 2009
Aug 2009
Jul 2009
Apr 2009
Mar 2009
Feb 2009
Dec 2008
Nov 2008
Oct 2008
Aug 2008
May 2008
Apr 2008
Mar 2008
Feb 2008