Log in

No account? Create an account
brad's life [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Cross-platform GUI stuff [Feb. 17th, 2005|03:26 pm]
Brad Fitzpatrick
[Tags|, ]

With the release of mono 1.1.4 it now includes the Cairo-backed GDI+ on Linux, atop which System.Windows.Forms is then implemented.

So you can build one .exe GUI app and run it on Windows, Linux, and even OS X. Craziness.

I've been thinking about the dozen ways to do this lately:

-- Qt 4.x which is now GPL on Windows. Pro: Mac, Windows, Linux, no dependencies. Con: C++, commercial for mac.

-- Perl-Gtk. downside: no mac, tons of dependencies, no good installers

-- Gtk# on Windows: runtime, installers

So it seems that System.Windows.Forms on both Mono 1.1.4 on Linux and the native Windows .NET libraries are the best bet. And C# as a language is pretty reasonable.

Alternatives? Think end-user experience.

P.S. If you install mono 1.1.4 and play with this, be sure to add this to $SYSCONFDIR/mono/config:

<dllmap dll="gdiplus.dll" target="libgdiplus.so.0" />

And make sure /usr/local/lib is in your library search path (LD_LIBRARY_PATH or /etc/ld.so.conf)

[User Picture]From: lithiana
2005-02-17 11:30 pm (UTC)
Java with IBM's SWT (the GUI library they use for Eclipse - looks like the native UI). it's actually usable, unlike standard Java UIs.
(Reply) (Thread)
[User Picture]From: brad
2005-02-17 11:31 pm (UTC)
Is there even a Java runtime on Windows anymore? I thought it was ripped out years ago, at Sun's request.

So a Windows user would need to go download and install a JRE first?
(Reply) (Parent) (Thread) (Expand)
(Deleted comment)
[User Picture]From: bitwise
2005-02-18 12:00 am (UTC)
wxWidgets? I've seen it used on a couple of things, though bittorrent (admittedly, not a complicated gui) is the only thing that jumps to mind. (See also wxPerl, wxPython)
(Reply) (Thread)
[User Picture]From: crschmidt
2005-02-18 12:42 am (UTC)
I've used wxPython for some cross platform work - it's pretty clean, but does require an extra install. Still, it's the only thing I've done significant GUI work with, and I've liked it.

That said, I'm thinking that Evan's idea below may be true: with Flash now moving to the mobile platform, I think that Flash could very easily become the Next Big Thing for cross platform GUI.
(Reply) (Parent) (Thread)
From: evan
2005-02-18 12:07 am (UTC)
I'm pretty convinced Flash is actually the future. Zero install, something like 90% market penetration, next version will have hardware acceleration, etc. If only the tools to create it were more free.

-- evan, who has drank the web kool-aid
(Reply) (Thread)
[User Picture]From: brad
2005-02-18 12:09 am (UTC)
There are CPAN modules to generate it.

But what if you want to break out of the sandbox and, say, read local files to upload them to a server?
(Reply) (Parent) (Thread) (Expand)
(Deleted comment)
[User Picture]From: brad
2005-02-18 01:41 am (UTC)
I'm talking about a FB upload app WITH A PROGRESS BAR. Find a way to do that in JavaScript/HTTP/server-side-crap and I'll lurve you forever.
(Reply) (Parent) (Thread) (Expand)
From: cjensen
2005-02-18 02:02 am (UTC)

Qt GPL Mac

Qt has been dual-licensed on the Mac for awhile now. Not as long as on Unix, but awhile.

So Qt works fine for cross-platform GPL licensed development.

I've done Qt development on Unix, and never had a serious problem porting to Mac and Windows. But yeah, I know the whole "Qt syntax" thing bugs some people.
(Reply) (Thread)
[User Picture]From: brad
2005-02-18 02:11 am (UTC)

Re: Qt GPL Mac

Oh really? Qt deserves another look.
(Reply) (Parent) (Thread)
[User Picture]From: smackfu
2005-02-18 02:40 am (UTC)
Do you have to go through X to get it to run on OS X?
(Reply) (Thread)
[User Picture]From: brad
2005-02-18 05:50 am (UTC)
IIRC, no.
(Reply) (Parent) (Thread)
[User Picture]From: jwz
2005-02-18 04:03 am (UTC)

A: don't.

Cross-platform GUI toolkits all look like ass, and will always look like ass. If you actually care about the thing being usable, then just bite the bullet and write the front end three times. It's not rocket science. (Well, I'm pretty sure whatever UI you're thinking about is not rocket science, anyway.)

If really the only bug you're trying to fix is that uploads don't have a progress bar, perhaps your time would be better spent fixing Firefox to have a progress bar on uploads?

Or you could have an iframe where the server is sending back a percentage report as it's receiving the file on another connection.
(Reply) (Thread)
From: evan
2005-02-18 04:34 am (UTC)

Re: A: don't.

Heh, I just suggested iframes above.

I agree 100% about cross-platform GUIs. That's why I suggested Flash: as soon as a user sees it's embedded in a website, they drop all of their expectations about the application and expect to have to figure out something new. For most of the small apps Brad wants they're all front end so it really boils down to writing the front end three times. And again, just for Brad's benefit, I already wrote the Windows front end, and that covers 95% of your users anyway.
(Reply) (Parent) (Thread)
[User Picture]From: mart
2005-02-18 09:12 am (UTC)

I was actually planning to write a new FotoBilder client at some point, although I was having the same problem as you deciding what was the best approach. When it comes to cross-platform UI libraries, I find that most of them end up looking alien on one or more of your target platforms because although the widgets are native, their placement and behavior is not. When I've done this in the past (with really simple apps in .NET) I wrote the backend once and just wrote multiple UIs which call that backend using an MVC-like approach. However, that was a pain in the ass because I had to implement all of the UI code twice. (Once for Windows.Forms and again for GTk#. I never finished the GTk# GUI.)

Recently, I've found that a few of them do it quite well. Qt and wxWidgets seem to do okay. I guess you don't really want to write in C++, but I'd imagine that there are bindings for Qt and/or wxWidgets for various languages, none of which would run as standard on any OS. Bundling assemblies wrapping the libraries alongside your app for .NET/Mono wouldn't be a major deal, though, right?

(Reply) (Thread)
[User Picture]From: mart
2005-02-18 09:19 am (UTC)

By the way, when I think “FotoBilder client” I think not only of uploading images, but also browsing and manipulating my galleries by dragging and dropping images and so on. Picasa's interface is what I have in mind, although obviously with a few adapatations to make it more suitable for FotoBilder. It was that I was attempting to clone when I started playing around with a FotoBilder interface in XUL, but I've long-since abandoned XUL as a viable platform since it carries around almost the whole of Mozilla with it and is a pain in the ass to build a standalone app with.

(Sure, it's possible that FotoBilder could serve the XUL app to Mozilla users, and that was how I was writing it initially, but that could probably do everything except upload due to the security restrictions.)

(Reply) (Parent) (Thread)
From: manuzhai
2005-02-18 10:10 am (UTC)


I still think XUL is rather cool for this stuff. Added benefit: UI's look good to me on Windows, and on Linux. Gtk stuff is ugly on Windows, don't know exactly about Qt, though. .NET probably looks good, but OMG the run-time, waste of memory.
(Reply) (Thread)
[User Picture]From: confuseme
2005-02-18 08:13 pm (UTC)
Wow, I didn't think this was going to happen for a long time yet! At work we're building a C# app, which is Windows-only for a number of reasons, but the biggest one is System.Windows.Forms. So maybe now a Linux version is vaguely plausible.

When you say "and even OS X", do you mean that mono has some native System.Windows.Forms implementation on OS X, or that the Linux implementation would be available via X11? An X11 app that can be made to run on OS X doesn't count as a viable "OS X version" to me.
(Reply) (Thread)