modGtk3 for Xojo

Linux has always been kind of an odd duck when it comes to Xojo.  If you create Linux applications with the IDE running in Linux the default sizes for controls is 26 which is different than MacOS or Windows since their default control height is 22.  See the initial screenshot:  the controls in Linux just don’t look right at the default Mac/Win control height.

The standard answer for many years was to subclass your controls and modify the height of the controls in Linux.  This was okay but it hard to make your UI look good on all three target platforms.

Xojo 2017 R2 changed the drawing system it uses.  The switch to GTK3 made it possible to modify the CSS of your application theoretically making it possible to make all platforms look and behave the same.

Just because you can modify the CSS means it’s a trivial task.  Several long time Xojo community members Jim McKay and Jürg Otter stepped up to the plate and put in the time to figure it out.  The result is at https://bitbucket.org/pidog/modgtk3/src/master/.

In this screenshot you can see that everything looks as you’d expect.

Implementing this in your own project is simple.  Download the BitBucket repository, open the project in Xojo and copy the GTK3 folder into  your own project.  Then in the App.Open event put these three lines in:

modGTK3.initGtkEntryFix
modGTK3.initGtkWidgetHeightFix
modGTK3.InitGlobalGTK3Style

That’s it.  Voila!  Now your app looks better in Linux and there’s no need to subclass your controls.  I realize this isn’t magic but it sure seems like it.

Xojo Open Source Projects

In my last post I talked about the state of the 3rd party market for Xojo.  It was a somewhat depressing talk for those already selling and a cautionary tale for those contemplating entering the market.  All is not bad news, however.  In some ways, the amount of open source source code available for Xojo is at an all-time high.

For many Xojo developers the must-have libraries are the Windows Functionality Suite  and MacOSLib .  These two libraries are great places to start to enhance your Windows and Macintosh applications respectively.  There are both free and wrap system API calls into Xojo classes and methods.  I would start with these two classes.

The folks at IntelligentVisibility have done some interesting things.  Their CalendarTimeChooser project is 100% Xojo code calendar and time chooser that is pretty slick, in my opinion.  Besides that they have a DropBoxAPI project, a Telnet class for Xojo, a Logging class, an AutoCompleteTextField, and a Loading Wheel control.

Long time Xojo user Kem Tekinay has released Kaju.  Kaju is a set of classes that can perform self-updates for your Mac, Windows, and Linux apps.  This solves some real world problems we all face and while Monkeybread Software has the Updater Toolkit it uses different technique for each platform and (from experience) troubleshooting can be difficult in getting the Sparkle framework working on the Mac.

Another long time user, Scott Boss, of Nocturnal Coding Monkeys, has released the Xojo Colors Module that aims to simplify the use of colors in your Xojo project.  Another project is XoDrill which is Xojo class that uses the Mandril APIs from MailChimp allowing you to send mass mailing through the MailChimp service.

iOS has only been out for one release, but it has received a lot of love from the community.  Some criticize Xojo for not being complete and not providing some basic functionality.  I disagree because Xojo should not have to provide everything – just the basics for us to do everything else.  I think it’s working because the work coming out of the community has been extraordinary.  If your Xojo iOS app needs gestures then xojoGestures is a great place to start.

If you are working with iOS then I hope you are spending a lot of time in the Xojo iOS forum.  The users there are turning out iOS declares at a prodigious rate and there are way too many to list here.  The forum should be your first place to search for a solution.

Xojo for iOS has introduced the new framework which, in come cases, is considerably different than the existing one.  XojoiOSWrapper  tries to bring those legacy framework methods to the new framework and specifically for iOS.  If you’re working with iOS AND desktop apps and trying to use a set of shared business logic between them you’re finding it hard to accomplish.  GlueKit for Xojo is a set of classes and methods from long time Xojo developer Phillip Zedalis of 1701 Software, that allows you to interact with a single class that bridges the new and old frameworks.

Perhaps this trend is part of a larger trend with software that tends to make things open source.  I’m still not convinced that this is the best thing, long term, but it does provide some stability with developers entering and leaving the community and having source disappear forever.  Regardless of the long term implications it shows that the Xojo community is alive and thriving.

If I didn’t catch your Xojo open source project I apologize profusely!  Any oversights are purely my error.  Please leave a comment with the link to your repository and a brief description of what it does.  And for those of you wiling to share your work with the community a big hearty THANK YOU!