Cross platform - for real? Or not really?

I am using GTK4 for all my development now.

My topic is best described, if you think of the application Scrivener. It is software for writers, and there is a Mac version, a Windows version - but NOT a Linux version. There use to be a linux version, but the Litterature and Latte or what ever that company is called, said they could not maintain and develop several version etc, so they dumped the Linux version.

Here is the thing: It is Qt.

So I was wondering why they have such a problem. I though they could just compile the thing on Linux and then on Window, and then on Mac, and the Qt would make that app run perfectly on all these systems?

Do I have the same problem with GTK4 ?

Or will my app, that I am now developing on a debian box, work fine under Window?

I am only using GTK functionality and standard C library stuff. Some Sqlite for database, but no other libraries.

Or could I end like these Scrivener people, that had to maintain 3 versions?

Is GTK4 really cross platform, in the sense that what ever you write on Linux, using the library functions, will work on Window and Mac?

There is no such thing as a “write once, run anywhere” toolkit; unless your application is trivial, it will require adaptations to fit in on any platform you support, because people using it expect that to happen. You can ignore that, and target no platform, but then your application will look and feel alien everywhere.

GTK (2, 3, 4, or any future version) is a portable toolkit: you can write your application on a platform, and then port it to other platforms that are supported by GTK—which, currently, mean Linux (and possibly other Unix-like OSes), Windows, macOS, and (experimentally) Android.

By “port” I mean that you will have to adapt your code to each platform. For instance: if you’re targeting macOS you will need to set up shortcuts and accelerators to use the Command key and the macOS-specific key combinations yourself. GTK cannot do that for you.

GTK, at most, guarantees that the UI-related code will likely work on its supported platforms; that does not mean that the application will run as a native application, or that it’ll be integrated, or that it’ll be performant. Additionally, that guarantee is only ever made for UI-related code.

You will always need to maintain platform-specific code. The size of that platform-specific code, compared to the overall code base of your application, depends on your application and your goals.

4 Likes

Sure, but shortcuts and accelerators are minor stuff. I’m talking about a company that does not have capacity to maintain to versions of a text editor, and therefor that porting every new version, must take them a massive amount of work.

What I hear from what you are saying, is that Qt is not honest in their marketing (not sure if that is what you are actually saying, but that is what I’m hearing).

At the same time I’m also hearing that porting a GTK4 app from windows to Linux or the opposite direction, is about shortcut keys and minor stuff?

I guess I’m just trying to get a feel for how much work it would be, to guaranty my customers both a Linux and a windows version of my app, and what issues I might run in to.

Qt does not promise you’re not going to have to write platform-specific code, so they are not “dishonest”. Qt has multiple dozens of engineers working on different platforms as well, to ensure that their own code is portable.

GTK has about 3-5 people working on it, mostly on their spare time. This means we make even fewer promises about the supported platforms.

That was just an example off the top of my head. Porting an application to Windows, or to Linux, can be quite involved and quite labour-intensive; it depends on the application.

Again: it depends on your application.

If you have customers, and you want commercial guarantees, my suggestion is to find somebody that can offer you some paid support. GTK developers are volunteers, and volunteers should not be placed in a position of providing support to commercial entities.

2 Likes

This is from the Qt website:

CONSISTENT

Cross-Platform Development

Ensure a seamless native look-and-feel for your applications across all major platforms.

With Qt, you can compile your application for a variety of platforms ensuring native experience on Windows (including Arm architecture), macOS, Android, iOS, and more.


My comment:

To me this marketing, specially the word seamless, either make them dishonest, or way better at this than you think they are.

Regarding my customers, i have two (2) customers. Its not like i am loaded.

Is GTK4 really cross platform, in the sense that what ever you write on Linux, using the library functions, will work on Window and Mac?

Having maintained a multi platform GTK4 app (Gaphor) for a while I found that every platform (Windows, Linux, macOS) has its own quirks. If you want good integration, you need to cater for that. E.g. drop a file on the icon in the dock/taskbar, and make it open in a new window. Menus are handled differently on each platform. Window buttons are located on different sides of the window, so your UI has to adapt for that.

Next to the code, there’s also the infrastructure needed to bring it to your users: you need to package your app. Make an installer for Windows (and sign it). Make a DMG for macOS (and notarize the binaries). Flatpaks on Linux.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.