The Top 10 from the MBS Xojo Plugins in 2022

In this article I would like to present you 10 highlights from the MBS Xojo Plugins innovations of 2022.

MongoDB

The MongoDB section joined the family of plugins in release 22.3 and has been developed further since then. You can use Xojo to access MongoDB databases, read, write and delete data. The special thing about Mongo DB is that it is not a rational database that is limited by relationships and tables, but is based on a JSON-like structure that also allows unusual queries. For example, you can formulate searches to see who has been in your company longer, the carpet in the warehouse or your employee. In rational databases, your carpet wouldn't normally appear in the same table as your employee. So you would have to design a separate table to be able to make this query. In Mongo DB, the records, here called documents, can coexist in the same collection and a simple query can be made.

In Release 22.5, another important innovation was added for this area. You can now also execute transactions on MongoDB. Normally, every change in the database is immediately applied as soon as it has been made. But this is not always desirable, e.g. when it comes to security relevant things where multiple records have to be changed. If in the middle the connection breaks we don't know in which state our database is, which records have been changed, which not. For this there are the transactions, with which we can tell the database to make all changes at once or to reject all changes made.
If you would like to try Mongo DB, please check out our examples.

(more)

Avoiding macOS Ventura crashes when loading plugins

Since macOS Ventura was released in October, we got plenty of crash reports from Xojo developers. There are bugs in macOS Ventura when loading dynamic libraries. Loading a dylib crashes with a probability of around 1%. Now a full set of MBS Plugins has over 500 dylibs and in our tests the crashes usually happen in the higher ranges like after 300, 400 or 500 dylibs are loaded. The crash reports look like this:

Process:               Xojo [...]
Path:                  /.../Xojo.app/Contents/MacOS/Xojo
Identifier:            com.xojo.xojo
Version:               22.4.0.... (22.4.0.3....)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               ...

Date/Time:             ...
OS Version:            macOS 13.1 (22C65)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   dyld  ...  dyld4::RuntimeState::addPermanentRanges(dyld3::Array const&) + 44
1   dyld  ...  dyld4::RuntimeState::addPermanentRanges(dyld3::Array const&) + 24
2   dyld  ...  dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()() const + 1128
3   dyld  ...  dyld4::APIs::dlopen_from(char const*, int, void*) + 892
...
8   Xojo  ...  PluginBridge.LoadPlugin%b%oo + 96
9   Xojo  ...  RBLibrary.LoadOnePlugin%o%obb + 4396
10  Xojo  ...  RBLibrary.LoadPluginsFromFolder%%ooA1obb + 2304
11  Xojo  ...  RBLibrary.LoadUserPlugins%%o + 1512
12  Xojo  ...  RBLibrary.Load%%o + 10100
13  Xojo  ...  IDEApp.Event_Open%%o + 64312

First since there are several bugs and Apple fixes bugs, please install updates for MacOS Ventura. Also make sure you have recent versions of Xojo (2022r4.1) and MBS Plugins 22.5 (or 22.6pr4), so you benefit from fixes related to macOS Ventura.

Next, please reduce the number of plugins you use. MBS Plugins contain 500+ dylibs with thousands of classes, but you probably only need a few plugins. So instead of 50 plugins installed, you may just go with 10 to 20 and not see the crash described above. Please check dependencies here. You need at least Main plugin for version and license handling. If you use various MacOS related plugins, you also need MacBase for some base classes. But not everyone uses our XL, OCR or Phidgets plugins.

If you like to know what plugins you use, just look into the built application. For macOS open the package with contextual menu and look into Contents/Frameworks folder. For Windows and Linux, please looks in the Libs folder. You may then lookup plugin part names to find the plugin.

When Xojo still crashes on launch, just try again. Usually it works fine after one or two crashes. We hope Apple fixes their bugs in the future with an upcoming update. Or tells us what to change on linking to avoid this.


Merry Christmas

Frohe Weihnachten und ein gutes neues Jahr!

Merry Christmas & Happy New Year

Joyeux Noël et Bonne Année

Buon Natale e Felice Anno Nuovo


Franziska, Sebastian, Michael, Monika & Christian Schmitz

API diffs for Xojo

Recently Norman got surprised about a change in a framework class. The EmailMessage class now has a computed property instead of a method pair for the Source property. While that doesn't change the functionality much, it does prevent you from subclassing and overwriting the methods.

Let's make diffs between the different versions of the framework classes. First attempt is to use Introspection, but for that we have to collect all the class names, which may be error prone. With introspection, we miss modules, global functions and many details like parameter names.

(more)

MBS Xojo Plugins, version 22.6pr4

New in this prerelease of the 22.6 plugins:
  • Updated Xcode to version 14.2.
  • Added WindowsThreadExecutionStateMBS class.
  • Added built-in library for Scintilla control for Linux 64-bit ARM.
  • Fixed a bug in DynaPDF where rendered image would show a picture (qr-code) inverted.
  • Fixed a problem with tesseract5 plugin on Windows, so Visual Studio 2019 runtimes are no longer needed.
Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.

Scintilla in Xojo for Linux 64-bit on ARM

We are happy to report, that Xojo with our plugins work fine in 64-bit ARM target for Linux:

Today we got Scintilla control (ScintillaControlMBS) updated to include a built-in library, so the control can be easily used out of the box without providing your own library.

The ChartDirector examples also work, but you need to install fonts and tell our plugin where they are with the CDBaseChartMBS.SetFontSearchPath function.

Since Xojo 2022r4 introduced building desktop, console and web applications, we see an increase in Linux developers asking about it. We'll add more Linux 64-bit ARM support and fix issues as we find them for the upcoming 23.0 release in January. Please report problems you find.


Bluetooth LE on Windows

Connecting to a bluetooth LE device on Windows and reading values is a multi step asynchronous procedure. You have to manage the state in your code to know where you are. You call plenty of functions and later you receive the callbacks to react to them, either as event or delegate method call. Here are the steps you may need to do:

Find device

Use WindowsBluetoothLEAdvertisementWatcherMBS class to watch for devices. You get the Received event call for each device found, so you can inspect the argument with the WindowsBluetoothLEAdvertisementReceivedEventArgsMBS object. Pick the bluetooth address from advertisement, an UInt64.

Open device

Use WindowsBluetoothLEDeviceMBS.FromBluetoothAddressAsync to create the device object from the address. If you alternatively have the Id, you can use FromIdAsync method instead. When your delegate is called later, take the device object and continue.

(more)

CallKit extension for Xojo iOS application

You can add a CallKit extension to your Xojo iOS application. This extension can provide names for phone numbers to iOS as well as block specific numbers. The extension is a background application, which is called from time to time to be asked for new data. Your main application may manage a database of phone numbers, which is then used by the extension.

Since we can't write the CallKit in Xojo right away, we need to write the extension in Xcode. In Xcode you make a new iOS App project. The name doesn't matter, but it may be good to match it to your main application in Xojo and use the same bundle identifier, so Xcode can setup provision profile for you. Then we you have the settings open for the project, on the bottom below the targets is a plus button. There you can add a new target for the Call Directory Extension.

(more)

Xojo 2022r4 released

Short before year's end, we get a 4th release for Xojo for 2022. Download here. Release Notes here. This release brings a couple of important bug fixes and new features, so let's dig into it:

Linux 64-bit for ARM

Finally we get 64-bit ARM support for Linux. And if you like to try it, be sure to install our MBS Plugins 22.6pr3 (or newer) to get support for the new platform. We worked on this for a year now and already updated all plugins to build for it. This includes MBS Xojo ChartDirector Plugin for our chart engine. The MBS Xojo XL Plugin is not yet updated for Linux 64-bit ARM as we plan to do this with the upcoming 4.1 release of LibXL. Let us know if you run into a class or function not working on Linux 64-bit on ARM, so we can check. Please try it for your desktop, console and web projects.
For other plugin vendors, it looks like Björn from Einhugur.com is also busy to update. (more)

MBS Xojo Plugins, version 22.6pr3

New in this prerelease of the 22.6 plugins:
  • Added WebSocket functions for CURL Plugin.
  • Added AccessoryViewDisclosed property to NSOpenPanelMBS class.
  • Added showsTagField property to NSSavePanelMBS class.
  • Added tagNames and setTagNames methods to NSSavePanelMBS class.
  • Fixed a problem with isMonterey and isVentura in SystemInformationMBS class not recognize the version correct if parameter OrHigher is false.
  • Added Text property to JSONMBS class.
  • Added Day and Month to MBS module for conditional compiling.
  • Added CURLSWebSocketFrameMBS class.
  • Added WebSocketMeta, WebSocketReceive and WebSocketSend to CURLSMBS class.
  • Changed minimum iOS version to version 11.
  • Added parameter for SetNextDragImageMBS function to define how many drag items you have. Default is one.
  • Changed OptionConnectOnly to integer in CURLSMBS class.
  • Changed MimeAttachmentMBS class properties to read only.
Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.

Three weeks till year's end

The year 2022 will end in less than three weeks. Do you need some more licenses?
  • You can order licenses for 2023 or later and have invoice, delivery and payment done in 2022.
    This way you secure the current pricing and the possibility to keep upgradeability for older licenses.
  • And of course you can order updates for several years in advance for all your MBS products.
  • As all our Xojo and DynaPDF plugin licenses are per developer, you should check if you got a new developer in your team this year and adjust licenses to match team size.
  • For MBS FileMaker Plugin please check if you have enough license for the number of seats or servers you have in use.
    If you upgrade to unlimited seats or servers, the plugin won't need to check the usage counts.
Especially if you run on a budget and you want to spend some money in the old year, you can buy updates for several years in advance. If you need help to decide what Xojo, FileMaker or plugin license you need, we may be able to assist you.

Unblock menus while threads are running

We recently got our TimerMBS class (22.6 or later) to help in cases, where using a menu on Windows stops your background threads. On macOS and Linux your threads continue to run when the user clicks on the menu and takes a while to make a choice.

So for Windows you can run the following code in your app open event to install a global TimerMBS and have it yield time. This makes sure that your main loop runs at least 10 times a second, even if a menu is open.

Sub Opening() #if TargetWin32 // start timer to yield in order to keep threads running when you use PopupMenus Static timer As TimerMBS timer = New TimerMBS(100, False) timer.Yield = True #EndIf End Sub

Alternatively, you would only enable it, when a thread is running. And then stop it later when the thread is done.

Please try and let us know whether it works well for you.


Using MBS to Extend Xojo - Xojo Developer Retreat 2022

We got the recording from my presentation at the Xojo Developer Retreat 2022 in Nashville from last September:



Watch on YouTube   Slides Download as PDF

For next year, there is a bigger three day conference coming to London from 26th to 28th April 2023. See XDC Website.

XDC 2022 Highlights Video

There was a smaller two day conference in Nashville a few months ago, where we had a lot of fun to meet Xojo developers from around the world. Check out the video:



Watch on YouTube

For next year, there is a bigger three day conference coming to London from 26th to 28th April 2023. See XDC Website.

Change brightness saturation and hue by Magick

Do you think that our monkey is a bit pale around the nose? Today we want to change that. We also have a method from the GM16ImageMBS class that can change the saturation of an image. The modulate method. But not only the saturation can this method influence but also the brightness of the image and the hue. So we can change the Hsb values of an image. In the parameters we then specify the corresponding values. If one or more of these three values should not be changed in an image, then we write a 100 in this place in the parameters. The 100 is the neutal value.

 image.modulate(100,100,100)

Brightness and saturation are relatively easy to understand if we set the brightness to a value greater than 100 then the image becomes brighter and if the value is less than 100 then it becomes darker. Similarly, if the saturation is greater than 100, the saturation will be higher, and if it is less than 100, the saturation will be lower. We can move within the value range from 0 to 200. With the Hue factor it is not so clear what we are actually doing. Here, too, the values are between 0 and 200. We know that from many programs we can specify colors with the help of the color wheel.

(more)

MBS Xojo Plugins, version 22.6pr2

New in this prerelease of the 22.6 plugins:
  • Added ReSVGMBS class.
  • Changed OutputData in CURLSMBS class and similar to raise OutOfBoundsException if data is too big (>2 GB) to fit into a string.
  • Updated DynaPDF to version 4.0.70.201.
  • Changed JSON parser to skip non breaking spaces like regular spaces.
Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.

Watch changes in MongoDB with Xojo application

We recently added MongoChangeStreamMBS class to watch changes in the database. You can monitor a database, a collection or the whole system. We show you today on how to use that in Xojo.

(more)

Crash Protection for Xojo methods

Sometimes you may have a situation, where you want to try something, that may crash. This may be a problem outside your control like a system or library function. Or some pointer reading may cause a page fault and you like to try it. Or some code produces crash reports for your users and you like to catch it and show a bug reporter dialog to get more details on why it crashes in a method.

We got recently a CallDelegateCrashSafeMBS module with a CallDelegateCrashSafeMBS method, that calls a method on your behalf. If it crashes, we raise a DelegateCrashExceptionMBS to inform you about it. The error message may tell the error like: "Delegate crashed with invalid pointer access."

(more)

MBS Xojo Plugins, version 22.6pr1

New in this prerelease of the 22.6 plugins: Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.
The biggest plugin in space...

Archives

Jul 2024
Jun 2024
May 2024
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