In 2012 I could pack a whole Python interpreter, Qt and various image-processing libraries into an InnoSetup installer that just-so scratched the 12 MB mark; I doubt this has changed significantly.
Contrary to what the linked (more interesting) survey article suggests, Qt is usually the answer to most issues when it comes to cross-platform UI.
Gtk is not bad, but Gtk is what it is: it was created because Qt couldn't be used for licensing concerns (at the time) by people unexperienced with the matter (compared to the Trolltech staff), and is maintained by people who, for the most part, care about Linux. Qt on the other hand is supported commercially, and puts far more effort into supporting more platforms better. [Also the tooling and docs are really nice].
Back when I did Win32 packaging of cross-platform applications, I never liked InnoSetup much, mostly because of the many levels of unpacking into temporary directories, but also because it was relatively slow and not as compact as it could be. Instead, I always preferred NSIS using the makensis command.
Among others, NSIS can be compiled on *nix systems, but still produces a Windows executable file (like a cross compiler), so you can put it in your cross compiling toolchain. That way, you can create your full Windows port including installer without ever having to touch a Windows.
InnoSetup was very easy to get started with and get the expected results, while NSIS looked more complex. I'm not particularly opinionated about installers as long as they install and uninstall things :)
While I agree about the respective qualities of the toolkits, if I remember correctly Gtk wasn't initially a replacement for Qt, but for Motif. The first version of Gimp was using that, and there was quite a bit of animosity against C++ back in those days.
They still could've tried to contribute to LessTif or at least created a new Xt-based toolkit instad of creating yet another overly verbose C OO system...
GTK was created for Gimp.The acronym was literally "Gimp ToolKit". It was adopted by the Gnome people, for the reasons you stated (KDE used Qt and the license issue was yet unresolved at the time). And for writing a PhotoShop-style program, at the time, it provided a lot that Qt couldn't.
In fact, Gimp stayed on GTK1 years after everyone else moved to GTK2.
Maybe, but what would be the point? I knew Qt already (although it's pretty easy to get started), and the UI of the application was quite complex and even with Qt had some custom, complex UI widgets (a node-graph editor, keyframing widgets etc.) -- although these were quite easy to implement on top of QGraphicsView. I'd expect that it would've been more effort to develop that with something like Tk.
+1.
Unfortunately it pays the "not being C, C++ or Python" tax in having therefore much less popularity than GUIs based on the above, but to me is among the best solutions around.
http://www.lazarus-ide.org/
edit: ...And it produces working GUI applications on *PI boards too (ARM). That's one big step beyond being Linux+Mac+Windows only.
I had a look at this again a few months back - Lazarus is where I got to also - but it felt a bit of an underwhelming/complicated solution esp. if you used Delphi or even VB 20 years ago
more and more people are talking about it again now - even though most of the current tooling hotness is focused on mobile
maybe something will come out of the .NET Core projects now it's all open source - it feels like that has most potential right now
there is a huge gap in the enterprise software market for a simple cross-platform app framework with intuitive ways to interface to SQL and web APIs - suitable for accounts juniors to build small data apps (instead of bending Excel macros round the problem) but also suitable to build high-function business apps (instead of pretty but barely usable web apps every business I know has on life-support which nobody dare touch)
Thanks for posting this. I've just reached the point where I need to look around for a cross-platform RAD tool for a side-project which will require a lot of experimentation, so this is fortuitous timing. :)
I coded a viewer for a binary file format reader at work that launched Octave via a TProcess and communicated with it over pipes. Rather than rewrite the Matlab that did the file processing, I just called the same functions our analysis guys were using. To get the data into Pascal, I had Matlab write binary files to disk and then read them in - this is because the pipe implementation on Windows (it was faster than the pipe).
Then I used the BGRABitmap's BGRACanvas as a component to draw the bitmap images (frames of data). To this I added some crosshairs. There is also a chart component that displays the data that makes up our range calculation.
It came to ~5MB executable, one non portable function (I asked Windows the size of the file Octave is writing until it returns the correct value, and I block on it - not bright, but easy to do. I prime the message pump with Application.ProcessMessage in that loop so the user doesn't see the blocking action.
I compressed the executable down to 1.5MB, just to see how far it would go. The project is portable to Linux except for the one function (which will go in an ifdef when I get around to it).
All of this with visual feedback, no make files, and 100% free as in freedom, Borland/Embarcadero can't take it from me, can't "change directions to focus on Enterprise", whatever.
The community is amazing, and answered all of my questions, and many of them really know their shit.
Thanks for sharing your real life experience, as a Delphi developer I've been watching FPC/Lazarus becoming more and more mature over the years, what a exciting thing! If you need an ORM/Web framework, check mORMot out, with the supplied rich set of samples, it's easy to get started: https://github.com/synopse/mORMot/tree/master/SQLite3/Sample...
My only experience with Pascal has been really old-school Pascal, which is a pointers-and-explicit-allocation language like C; if you want a map of things, you need to build one from scratch, track pointer lifetimes, remember to free stuff explicitly, etc.
You have the option to do it manually, of course - full power to the programmer! However...
If you don't want to track pointer lifetimes, you can use interfaced objects, which are reference counted. There are tradeoffs there, but you get to choose them.
The Lazarus IDE is setup out of the box to have debug builds include heaptrc - running your program in debug mode gives you a printout of anything you forgot to free. This is what I've been using.
Do you have a particular example or data structure you're interested in? I'd be glad to help determine if FPC/Lazarus fits your use case.
I think that would have more to do with the applications themselves as opposed to anything intrinsic to Delphi. I've used plenty of applications written in Delphi and they've worked fine. Skype for Windows was written with Delphi (and maybe still is).
I would guess that's mostly a result of a lot of them being Q&D ("RAD") database CRUD interfaces, done on contract by a single developer, rarely touched again. Those tend to be awful in every language.
It's been a while, but I think my main complaint about Delphi was grid-based layouts and the static interfaces it creates. Fast, but usually don't respond well to resizing.
Why does the fact that GTK "looks non-native on Windows" disqualify it? If it's pretty enough for Linux, isn't also good enough for Windows? (Also my personal opinion is that it doesn't look too bad.)
Consistency is non-existent amongst apps. Even on OSX, for all their insistence on their Human Interfaces Guideline, the experience of using multiple apps is still a patchwork of styles. If your needs are fairly generic, you can assemble a fairly consistent set of apps, if you accept some that are crippled or plain lousy.
Not personal but I can't resist: "A foolish consistency is the hobgoblin of little minds." (Emerson)
Looking at something like gsmartcontrol I can only spot the few icons being different than the shell32 ones, so it's still more consistent than most commercial software.
Why should anybody have to put up with non-standard UI and behaviour?
(Case in point: the very website's scrolling. Works great on desktop Firefox, not obviously distinguishable from any other website. On iOS... a sad joke, made at the user's expense.)
Yes, and the reader mode was not available to me a first too. I believe I used the option to request the desktop page and then the icon appeared in the url bar.
GTK is also totally inaccessible to blind people, and possibly people with other disabilities as well, on Windows and Mac. I'm guessing you don't want to accidentally block people from using your application.
Do Gtk programs on Windows or Mac have the same, non native file selector dialog? I mostly use Linux (Ubuntu with i3wm) for coding and what annoys me most on daily basis are the file pickers on different applications. They are not only inconsistent, they are also all bad compared to Windows and Mac. It takes me far more time to select files than on the other platforms. Granted I use it mostly by far when webbrowsing as I use the commandline mostly but still at least a few times per day. I cannot check if Win or Mac Gtk apps use the platform picker or a Gtk one: if the latter, that would stop me from deploying software in Gtk on other platforms.
I think it just depends on the nature of the software, if it's something I used every day I want as close an integration with the platform as possible. On the other hand if it was something I used once a month to manage my payroll for example I wouldn't worry too much.
There is a way, but it involves a bit of work (again because the author used styles that hide everything unless the JS runs).
Save the page to disk (Firefox: File->Save Page As).
Then open the saved html file in a text editor and delete all of the <link> tags in the <head> section that reference style sheets and save the changes.
Then open the edited html page from disk, and the result will be printable.
It seems like the only real complaint this article addresses is that gtk (or other non-native toolkits) add a ~20mb dependency, and Windows didn't have a good package manager (since static compilation is preferred).
Frankly, this is a non issue. Windows users are used to this. It comes with the territory. Toolkits like GTK and Qt are full featured, densely documented, fast, look good, and work well in any OS.
took me a second to realize how important this is; my brain dismissed the final solution as 'so what, that's just like HTML'.
then I got it -- the ability to use code generation to be declarative is incredible.
having the ability to mix declarative (HTML / data structures) and imperative (javascript) is what makes react so powerful. The ability to do that almost-natively inside the language is amazing.
Yeah I think one of the main things that React offers is a DSL for trees (JSX) that can lexically close over and also splice in JavaScript. Languages that allow creating your own DSLs offer this for other realms such as shader coding, logic programming etc. within the metalanguage.
Where do you see behavior mixing with presentation in wxnim's GenUI? The only thing that the macro is used for, besides saying what to draw and how, is to define events that the elements emit.
This approach lets you blur the lines between MVC responsibilities. If you wanted to create a widget that had some traditionally 'business-logic' role (like network sync or database interaction) you could do that. I'm not recommending that but there's value in flexibility.
The FB/google share buttons on websites totally break MVC. It's just a button but it has cookie & network traffic.
I hate those buttons, people often argue they 'break the web' because of weird privacy/performance side effects, but developers use them because it's convenient to 'drop in' the platform integrations.
By comparison -- integrating an android app with GMS requires modifying a bunch of files (xml layouts, java source, multiple build dependency files). You can't just 'drop it in'.
I've been struggling with finding a good cross-platform C#/.NET framework that can tie into Visual Studio.
So far, you're making your entire UI in code (Like WxWidgets), having to use an app like XamarinStudio to even get fully packaged OSX apps, along with requiring an external framework such as https://github.com/picoe/Eto, (its official package is broken in Xamarin though)
I understand that win forms may not be great when you start to build a bigger application with a lot more presentation and data, but it makes building simple apps easy and convenient. We need something like that cross-platform.
If anyone knows more about re-creating windows form apps cross-platform in a nice manner, I'd appreciate the info.
I don't spend much time w/ that stack, but Avalonia [1] seems to be a big player. Even better, they recently merged .Net core support [2]. You of course lose some native look and feel.
This may be too small of a place to explain it and I'm not completely familiar w/ the ecosystem, but .Net core is the .Net runtime built for cross-platform use. It doesn't have all of .Net framework, but they are adding a bit at a time. See https://www.microsoft.com/net/core/platform
I tried flicking the page right above the code fragment, but it turns out the scroll hijacking disables iOS's native inertial scrolling, so there's no way for me to read the rest of the article until I get back to my desktop.
I don't see the need for down-votes here: clearly many authors (in absolute terms, if not relative terms) tease their viewers with 30 minutes of reading, only to frustrate them by making the rest of the page inadvertently unreachable. I would think of these kinds of comments as a courtesy to the author.
You can read the article normally by using reader view on both Safari and Firefox, which make almost any article better to read anyway, at the expense that code blocks won't be properly formatted (in this case, on some sites code blocks just disappear).
Do most GUI toolkit whinges ever come to accept the fact that most of these issues would go way if Trolltech/Qt/Digia/Nokia would actually bite the bullet and create a simple C interface to the C++ that even other C++ compilers cannot link cleanly to?
C++ and its co conspirator Javascript have done so much to hinder programming development over the past 20 years.
Linux has been round for over and there isn't a decent opensource graphical debugger for Linux that Visual Studio will have to step in some time in the future. All this is soooo depressing.
Brilliant idea! The code sample is the most clean GUI code I have ever seen. However, I haven't coded GUI for a very long time, so it may be that there are also other good GUI APIs which I don't know about.
Nevertheless, this DSL reveals how powerful Nim actually is. It seems many developers have not realized it yet. With Nim they get C performance, seamless C FFI, and a very expressive pythonic syntax. I am using Nim for years now, and it's amazing how productive coding can be.
I wish someone would pick back up wxc, the C interface for wxWidgets. IIRC the latest updates are in the wxc folder of wxHaskell [1]. That any non-C++ language is able to somewhat "import C++" (i.e. Nim and D) is nice and all, but doesn't really help the larger community and can be brittle in some C++ situations.
So I have used wxWidgets in the past with the help of python bindings and enjoyed using it and my end product. I hear electron[1] is picking up these days for cross-platform dev - anyone got experience with it?
Only from an end user perspective and frankly I hate it. It has all the size and performance problems complained about in that article but without the benefit of native widgets. And frankly if I wanted to run a web app on my desktop then I'd rather run it in my preferred browser.
I know I'm getting old (in IT terms) and grumpy but I'm unconvinced our current frontend web stack are the right tools for modern web development; albeit it's what we're stuck with. So I'm even less convinced that it's the right stack for "native" desktop applications.
To be honest I've never been a massive fan of GTK either. Then or now. Though at least I can sympathise a little more with why GTK existed and at least GTK is native so still had better comparable performance (ie performed better on average hardware of that era than electron performs on average hardware of this current era).
FLTK is extremely lightweight and easy to use, and quite fast to boot. It doesn't integrate very well with e.g. platform accessibility hooks and stuff like that (but then, not many toolkits do). Highly recommended if you're using C++.
FLTK's major problem is that it is too much of a C++ system; while wrappers for some languages exist, a lot of the properties that make it desirable in C++ are lost through those wrappers.
The language itself also has some serious race conditions that are impossible to debug unless you're on really slow/embedded hardware. For example, I used the Dillo web browser (which is FLTK-based) for a couple years when I was stuck on an 800MHz PC, and when the system was swapping heavily, doing things like opening the (FLTK-generated) file-save dialog or dragging a window scrollbar (IIRC) would lock the mouse - FLTK uses X11 cursor locks to constrain the cursor in some situations, and due to the system's heavy I/O load, FLTK wasn't releasing the locks, and I had to kill the entire browser.
Hmm. Good point; AFAIK Dillo doesn't use threading.
I'm honestly not sure what was causing it, but I know that it only happened when the system was swapping a lot. So something that expected something else to be done or take a short amount of time didn't.
For all I know it could be the way FLTK is using Xlib (I don't think it uses XCB yet).
I am looking for a cross-platform GUI library that feels native across Mac/Win/Linux and has well maintained bindings in a language that is not C++ - an impossible task it seems.
GtkAda is a binding for Ada. Ada is like
Pascal but much more powerful. GTK is available for Linux, Windows and OSX. However, you could also use Qt and import from C++ to Ada.
Quick and dirty bindings? No. Ones that actually take into account the idioms of the host language and build idiomatic abstractions around the raw bindings? Not necessarily hard, but requires a significant time investment.
Contrary to what the linked (more interesting) survey article suggests, Qt is usually the answer to most issues when it comes to cross-platform UI.
Gtk is not bad, but Gtk is what it is: it was created because Qt couldn't be used for licensing concerns (at the time) by people unexperienced with the matter (compared to the Trolltech staff), and is maintained by people who, for the most part, care about Linux. Qt on the other hand is supported commercially, and puts far more effort into supporting more platforms better. [Also the tooling and docs are really nice].