Selecting a GUI toolkit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Selecting a GUI toolkit

Daniel Carrera-4
Hello,

This question is just idle curiosity. I don't actually plan to write a
desktop GUI program. With that said, what library would you recommend to
someone who wants to write a cross-platform desktop app with Haskell?

Consider the following requirements:

1) Cross-platform. Windows, Linux and preferably OS X too.
2) Maintained, stable, mature, documented, etc.
3) Easy to use.

Notice that this has much to do with the Haskell bindings. For example,
Qt might be a fabulous toolkit, but qtHaskell might be immature (it
looks like it started in Dec 2007).

wxHaskell looks good. I like the idea behind wxWidgets, but I have never
used it (or any GUI toolkit for that matter).

Thank you for your input.

Cheers,
Daniel.
Reply | Threaded
Open this post in threaded view
|

Selecting a GUI toolkit

Felipe Lessa
If I were to write one right now (and I might actually need in a
few days), I'd use Gtk2Hs.

Cons:
 - Does not fit Haskell's style.
 - Very imperative, everything in IO.

Pros:
 - Terrific binding: (almost) complete, working, tested.
 - Multi-platform (as far as Gtk itself is).
 - If you need, reading Gtk's C docs is straightforward.
 - Seamless integration with Cairo (yay!).
 - ... (probably more)

I already used Gtk on other languages before Haskell, though, so
I'm somewhat biased.

--
Felipe.
Reply | Threaded
Open this post in threaded view
|

Selecting a GUI toolkit

Daniel Carrera-4
Hi Felipe,

I think I read somewhere that Gtk2Hs is the more active project, so it
might be more mature. On the other hand, Gtk kinda sucks on Mac OS X. I
hate how Gimp or GnuCash look when I run them on OS X. On Windows Gtk
runs fine except that the file browser looks out of place.

Daniel.

Felipe Lessa wrote:

> If I were to write one right now (and I might actually need in a
> few days), I'd use Gtk2Hs.
>
> Cons:
>  - Does not fit Haskell's style.
>  - Very imperative, everything in IO.
>
> Pros:
>  - Terrific binding: (almost) complete, working, tested.
>  - Multi-platform (as far as Gtk itself is).
>  - If you need, reading Gtk's C docs is straightforward.
>  - Seamless integration with Cairo (yay!).
>  - ... (probably more)
>
> I already used Gtk on other languages before Haskell, though, so
> I'm somewhat biased.
>
> --
> Felipe.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>

Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Andy Stewart-5
In reply to this post by Daniel Carrera-4
Hi Daniel,
Daniel Carrera <[hidden email]> writes:

> Hello,
>
> This question is just idle curiosity. I don't actually plan to write a desktop GUI program. With
> that said, what library would you recommend to someone who wants to write a cross-platform desktop
> app with Haskell?
>
> Consider the following requirements:
>
> 1) Cross-platform. Windows, Linux and preferably OS X too.
> 2) Maintained, stable, mature, documented, etc.
> 3) Easy to use.
I use gtk2hs, it yes to all your need above.

I use gtk2hs-0.10.0 with GHC 6.10 (6.10.1 or 6.10.2) in Ubuntu (or Debian).

Below is detail install method:
1) Install GHC 6.10, :)
2) Install depend libraries:
sudo aptitude install automake libglade2-dev libgtksourceview-dev libgtksourceview2.0-dev libgconf2-dev librsvg2-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgtkglext1-dev libgnomevfs2-dev xulrunner-dev -y
3) Download gtk2hs-0.10.0:
http://downloads.sourceforge.net/gtk2hs/gtk2hs-0.10.0.tar.gz
4) Compile gtk2hs-0.10.0:
autoconf && ./configure --enable-docs && make && sudo make install

And this have tutorial that introduce how to use gtk2hs:
http://darcs.haskell.org/gtk2hs/docs/tutorial/Tutorial_Port/

  -- Andy

>
> Notice that this has much to do with the Haskell bindings. For example, Qt might be a fabulous
> toolkit, but qtHaskell might be immature (it looks like it started in Dec 2007).
>
> wxHaskell looks good. I like the idea behind wxWidgets, but I have never used it (or any GUI toolkit
> for that matter).
>
> Thank you for your input.
>
> Cheers,
> Daniel.

Reply | Threaded
Open this post in threaded view
|

Selecting a GUI toolkit

Felipe Lessa
In reply to this post by Daniel Carrera-4
On Thu, Apr 30, 2009 at 12:40:54AM +0200, Daniel Carrera wrote:
> I think I read somewhere that Gtk2Hs is the more active project, so it
> might be more mature. On the other hand, Gtk kinda sucks on Mac OS X. I
> hate how Gimp or GnuCash look when I run them on OS X. On Windows Gtk
> runs fine except that the file browser looks out of place.

Although I don't have access to a Mac, people usually don't like
Gtk there.  But there seems to be a native port somewhere that is
going to be merged into Gtk+ someday :).

Now, good support today for Mac OS X would be my only reason to
go through the wxWindows route.  I use Gtk+ because back in the
days that I tried wxWindows, it had a terrible appearence when
using Gtk as a backend, but probably things improved since then.

--
Felipe.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Heinrich Apfelmus
Felipe Lessa wrote:
> Daniel Carrera wrote:
>> I think I read somewhere that Gtk2Hs is the more active project, so it
>> might be more mature. On the other hand, Gtk kinda sucks on Mac OS X. I
>> hate how Gimp or GnuCash look when I run them on OS X. On Windows Gtk
>> runs fine except that the file browser looks out of place.
>
> Although I don't have access to a Mac, people usually don't like
> Gtk there.  But there seems to be a native port somewhere that is
> going to be merged into Gtk+ someday :).

I think the "native" refers not to the GUI appearance but to the feature
that you don't need an X server to run a Gtk application anymore.

> Now, good support today for Mac OS X would be my only reason to
> go through the wxWindows route.  I use Gtk+ because back in the
> days that I tried wxWindows, it had a terrible appearence when
> using Gtk as a backend, but probably things improved since then.

WxWindows on Mac OS X doesn't really look great either, I'm afraid.


Regards,
apfelmus

--
http://apfelmus.nfshost.com

Reply | Threaded
Open this post in threaded view
|

Selecting a GUI toolkit

Daniel Carrera-4
In reply to this post by Felipe Lessa
Felipe Lessa wrote:
> Although I don't have access to a Mac, people usually don't like
> Gtk there.  But there seems to be a native port somewhere that is
> going to be merged into Gtk+ someday :).
>
> Now, good support today for Mac OS X would be my only reason to
> go through the wxWindows route.  I use Gtk+ because back in the
> days that I tried wxWindows, it had a terrible appearence when
> using Gtk as a backend, but probably things improved since then.


Thanks. I guess one would have to try making a simple program with each
and see. After all, one of the selling points of WX is that it's
supposed to look right in all platforms. I have been sort of assuming
that between WX and Gtk you might as well pick WX because WX uses Gtk in
the platforms where Gtk looks right.

The choice would be simpler if Gtk ran natively on Mac. Right now it
looks horrible and it is hard to setup if you are not a technical person
or don't have the latest OS X. At a *minimum* you'll need to install
fink or mac ports and run the program from the terminal.

Btw, I have read the first few chapters of the Gtk2Hs tutorial. The code
looks extremely imperative. Even more than wxHaskell. I mean... initGUI,
"widgetShowAll window", "mainGUI"...

In principle I would be happy with any WX, Gtk and Qt. I think well of
all of them. It's just that they all seem to have a lot of limitations.

Cheers,
Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
In reply to this post by Heinrich Apfelmus
Heinrich Apfelmus wrote:
> WxWindows on Mac OS X doesn't really look great either, I'm afraid.

Really? The screen shots look good to me. See:

http://wxhaskell.sourceforge.net/images/controls-macosx.png

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Thomas Davie

On 30 Apr 2009, at 10:44, Daniel Carrera wrote:

> Heinrich Apfelmus wrote:
>> WxWindows on Mac OS X doesn't really look great either, I'm afraid.
>
> Really? The screen shots look good to me. See:
>
> http://wxhaskell.sourceforge.net/images/controls-macosx.png

Really, here's what that *should* look like:

http://www.cs.kent.ac.uk/people/rpg/tatd2/controls-macosx.png

Of note though, the main problem with WX is not that the controls look  
different, it's that they behave differently.  UI is not just about  
looks ;).

Bob
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
Thomas Davie wrote:
> Really, here's what that *should* look like:
>
> http://www.cs.kent.ac.uk/people/rpg/tatd2/controls-macosx.png

Your link is for Panther, my link was for Jaguar. The wxHaskell also has
a screenshot on Panther:

http://wxhaskell.sourceforge.net/images/controls-macosx2.png

> Of note though, the main problem with WX is not that the controls look
> different, it's that they behave differently.  UI is not just about
> looks ;).

Ok.. how do they behave?  I bet you that they behave better than the Gtk
controls on OS X... ugh.

You are right that UI is not just looks. That's another of the issues
with X11 on OS X, it behaves wrong. The command key doesn't do anything,
so for example, it's a major pain to use Gimp on OS X without a two
button mouse.

How about Qt? Do you know if Qt behaves well on OS X? I thought that Qt
didn't look native on OS X (I'm on Ubuntu right now, so I can't check).

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Thomas Davie

On 30 Apr 2009, at 11:12, Daniel Carrera wrote:

> Thomas Davie wrote:
>> Really, here's what that *should* look like:
>> http://www.cs.kent.ac.uk/people/rpg/tatd2/controls-macosx.png
>
> Your link is for Panther, my link was for Jaguar. The wxHaskell also  
> has a screenshot on Panther:
>
> http://wxhaskell.sourceforge.net/images/controls-macosx2.png

My link was on leopard actually, but that still looks significantly  
different to the natively designed UI.
>
>> Of note though, the main problem with WX is not that the controls  
>> look different, it's that they behave differently.  UI is not just  
>> about looks ;).
>
> Ok.. how do they behave?  I bet you that they behave better than the  
> Gtk controls on OS X... ugh.

I very much doubt that actually ? mac users in my experience notice  
when things are annoyingly slightly different from the norm ? a kind  
of uncanny valley effect, it's almost what you expect, but not quite.  
In the mean time, gtk being entirely non-OS X like running in X11 says  
"hey, I'm different, deal with it", and people do.

> You are right that UI is not just looks. That's another of the  
> issues with X11 on OS X, it behaves wrong. The command key doesn't  
> do anything, so for example, it's a major pain to use Gimp on OS X  
> without a two button mouse.

Well yes, but then all macs come with 2 button mice, so *shrug*.  But  
yes, X11 apps in general behave wrong, and mac users don't like them  
much, but they like them better than apps that pretend to be OS X  
like, but don't get it right.

> How about Qt? Do you know if Qt behaves well on OS X? I thought that  
> Qt didn't look native on OS X (I'm on Ubuntu right now, so I can't  
> check).

Qt get closer into uncanny valley than gtk does, because it runs  
natively.

This really though comes down to the fact that it's totally impossible  
to design cross platform UIs for applications.  Different platforms  
UIs behave differently, so deal with it, and write different UIs for  
the different platforms.  Don't expect everyone to fit into your one-
size-fits-all straight jacket.

This is extra work, but 1) it enforces a good abstraction layer  
between your UI and your actual application, and 2) it gives major  
benefits in terms of happy customers.

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090430/3468665d/attachment-0001.htm
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
Thomas Davie wrote:
>> http://wxhaskell.sourceforge.net/images/controls-macosx2.png
>
> My link was on leopard actually, but that still looks significantly
> different to the natively designed UI.

Significantly different? They are practically identical.

>> Ok.. how do they behave?  I bet you that they behave better than the
>> Gtk controls on OS X... ugh.
>
> I very much doubt that actually ? mac users in my experience notice when
> things are annoyingly slightly different from the norm ? a kind of
> uncanny valley effect, it's almost what you expect, but not quite.  In
> the mean time, gtk being entirely non-OS X like running in X11 says
> "hey, I'm different, deal with it", and people do.

I am a Mac user and I disagree. I know several mac users who also
disagree. I remember that NeoOffice used to be much more popular than
OpenOffice.org on Mac because OOo used X11 and NeoOffice didn't, even
though it was clear that NeoOffice was not quite native. You are the
first mac user I meet that feels the way you feel. I have met quite a
few mac users who don't share your views.


X11 apps look like crap. And I disagree with the "uncanny valley" thing
because *native* OS X apps can look quite different. There isn't a
single uniform look for native OS X apps but at least two. Looking at
the screen shots on the wxHaskell website, if I saw that on my Mac, it
wouldn't cross my mind that it isn't native.


> Well yes, but then all macs come with 2 button mice, so *shrug*.

Mine doesn't and every mac I've seen doesn't, so don't dismiss me like
that, it's very rude. Also, in macs the command key is used a lot, you
can't just throw it away and "shrug" like you just did.

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Andy Stewart-5
In reply to this post by Daniel Carrera-4
Daniel Carrera <[hidden email]> writes:

> Felipe Lessa wrote:
>> Although I don't have access to a Mac, people usually don't like
>> Gtk there.  But there seems to be a native port somewhere that is
>> going to be merged into Gtk+ someday :).
>>
>> Now, good support today for Mac OS X would be my only reason to
>> go through the wxWindows route.  I use Gtk+ because back in the
>> days that I tried wxWindows, it had a terrible appearence when
>> using Gtk as a backend, but probably things improved since then.
>
>
> Thanks. I guess one would have to try making a simple program with each and see. After all, one of
> the selling points of WX is that it's supposed to look right in all platforms. I have been sort of
> assuming that between WX and Gtk you might as well pick WX because WX uses Gtk in the platforms
> where Gtk looks right.
>
> The choice would be simpler if Gtk ran natively on Mac. Right now it looks horrible and it is hard
> to setup if you are not a technical person or don't have the latest OS X. At a *minimum* you'll need
> to install fink or mac ports and run the program from the terminal.
>
> Btw, I have read the first few chapters of the Gtk2Hs tutorial. The code looks extremely
> imperative. Even more than wxHaskell. I mean... initGUI,
> "widgetShowAll window", "mainGUI"...
Yep, very imperative, but it works.
At least gtk2hs is easiest way to build Haskell GUI program.

  -- Andy


Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
Andy Stewart wrote:
>> Btw, I have read the first few chapters of the Gtk2Hs tutorial. The code looks extremely
>> imperative. Even more than wxHaskell. I mean... initGUI,
>> "widgetShowAll window", "mainGUI"...
> Yep, very imperative, but it works.
> At least gtk2hs is easiest way to build Haskell GUI program.

Thanks.

It's hard to argue with "it works". I'd rather have something that works
on two platforms than something that fails on three platforms :-) Have
you any experience with wxHaskell? Do you find it harder to use? Or is
it more buggy?

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Heinrich Apfelmus
In reply to this post by Daniel Carrera-4
Daniel Carrera wrote:
> Thomas Davie wrote:
>>> http://wxhaskell.sourceforge.net/images/controls-macosx2.png
>>
>> My link was on leopard actually, but that still looks significantly
>> different to the natively designed UI.
>
> Significantly different? They are practically identical.

IMHO, they are quite different, and it shows. :)

The first difference is the spacing. In the wxHaskell version, the
enclosing tab is glued to the window border left and right, while there
is a considerable margin in the native version. The inner boxes have
spacious margins, too.

The second is the capitalization in the native version. That gives it a
totally different look! I even thought that they were using different
fonts at first.

Thirdly, the textlogs have different fonts. Again, the wxHaskell one
looks non-standard.


Overall, I think it's quite visible that the wxHaskell version is not
native. What I don't understand is why, though; after all, most of the
above is specified in Apple's Human Interface Guidelines, it's just a
matter of implementing them.


Regards,
apfelmus

--
http://apfelmus.nfshost.com

Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
Heinrich Apfelmus wrote:
> The first difference is the spacing. In the wxHaskell version, the
> enclosing tab is glued to the window border left and right, while there
> is a considerable margin in the native version. The inner boxes have
> spacious margins, too.
>
> The second is the capitalization in the native version. That gives it a
> totally different look! I even thought that they were using different
> fonts at first.

I didn't notice any of these except for the tab margin until you pointed
it out. The tab margin left and right is the only thing I noticed.
Taking a second look, I also notice the margin *below* the tab box.


> Thirdly, the textlogs have different fonts. Again, the wxHaskell one
> looks non-standard.

Honestly, I can't tell. They are both very similar, sans fonts. Also,
the font could  be explained by the fact that these screen shots are
taken on different computers (different OS versions, different settings).

I just went to the wxWidgets website. On that site, the Mac OS screen
shots show the buttons capitalized. In any case, I think these
differences are minor. More importantly, I'm not sure that a different
cross-platform toolkit would do a better job.

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Peter Verswyvelen-2
I thought wxWidgets was actually one of the only toolkits that actually
*used* the native GUI libraries???
See e.g. http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits

So I don't understand how come the look and feel is different then...

On Fri, May 1, 2009 at 11:26 AM, Daniel Carrera <
[hidden email]> wrote:

> Heinrich Apfelmus wrote:
>
>> The first difference is the spacing. In the wxHaskell version, the
>> enclosing tab is glued to the window border left and right, while there
>> is a considerable margin in the native version. The inner boxes have
>> spacious margins, too.
>>
>> The second is the capitalization in the native version. That gives it a
>> totally different look! I even thought that they were using different
>> fonts at first.
>>
>
> I didn't notice any of these except for the tab margin until you pointed
> it out. The tab margin left and right is the only thing I noticed.
> Taking a second look, I also notice the margin *below* the tab box.
>
>
>  Thirdly, the textlogs have different fonts. Again, the wxHaskell one
>> looks non-standard.
>>
>
> Honestly, I can't tell. They are both very similar, sans fonts. Also, the
> font could  be explained by the fact that these screen shots are taken on
> different computers (different OS versions, different settings).
>
> I just went to the wxWidgets website. On that site, the Mac OS screen
> shots show the buttons capitalized. In any case, I think these differences
> are minor. More importantly, I'm not sure that a different cross-platform
> toolkit would do a better job.
>
> Daniel.
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090501/defc7f19/attachment.htm
Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Heinrich Apfelmus
Peter Verswyvelen wrote:
> I thought wxWidgets was actually one of the only toolkits that actually
> *used* the native GUI libraries???
> See e.g. http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits
>
> So I don't understand how come the look and feel is different then...

Using native GUI libraries is necessary, but not sufficient for
achieving the same look and feel. :)

Other elements are layout and spacing,

  http://developer.apple.decenturl.com/human-interface-guidelines-layout
  http://developer.apple.decenturl.com/hi-guidelines-windows

drag & drop,

  http://developer.apple.decenturl.com/hi-guidelines-dragndrop

writing style and fonts

  http://developer.apple.decenturl.com/human-interface-guidelines-text

etc, etc.


Daniel Carrera wrote:
>>  Thirdly, the textlogs have different fonts. Again, the wxHaskell one
>> looks non-standard.
>>
> Honestly, I can't tell. They are both very similar, sans fonts. Also, the
> font could  be explained by the fact that these screen shots are taken on
> different computers (different OS versions, different settings).

There is a default set of fonts

  http://developer.apple.decenturl.com/human-interface-guidelines-text

The "mini system font" is the typography of choice for text boxes, but
it looks the "application font" is acceptable as well.

> In any case, I think these differences are minor.

I don't. :)

> More importantly, I'm not sure that a different cross-platform
> toolkit would do a better job.

True, that. It's just that this doesn't mean that wxWidgets does a very
good job.


Regards,
apfelmus

--
http://apfelmus.nfshost.com

Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Thomas Davie
This is one of many reasons why I don't believe any of these cross-
platform toolkits will ever be good enough to make truly native-like  
UIs ? The bottom line is that tab views are different between Mac OS  
and other OSes, they have much more padding round them on Mac OS.  
This means that any layout you create involving them will never work  
on both platforms.

Bob

On 1 May 2009, at 17:25, Heinrich Apfelmus wrote:

> Peter Verswyvelen wrote:
>> I thought wxWidgets was actually one of the only toolkits that  
>> actually
>> *used* the native GUI libraries???
>> See e.g. http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits
>>
>> So I don't understand how come the look and feel is different then...
>
> Using native GUI libraries is necessary, but not sufficient for
> achieving the same look and feel. :)
>
> Other elements are layout and spacing,
>
>  http://developer.apple.decenturl.com/human-interface-guidelines- 
> layout
>  http://developer.apple.decenturl.com/hi-guidelines-windows
>
> drag & drop,
>
>  http://developer.apple.decenturl.com/hi-guidelines-dragndrop
>
> writing style and fonts
>
>  http://developer.apple.decenturl.com/human-interface-guidelines-text
>
> etc, etc.
>
>
> Daniel Carrera wrote:
>>> Thirdly, the textlogs have different fonts. Again, the wxHaskell one
>>> looks non-standard.
>>>
>> Honestly, I can't tell. They are both very similar, sans fonts.  
>> Also, the
>> font could  be explained by the fact that these screen shots are  
>> taken on
>> different computers (different OS versions, different settings).
>
> There is a default set of fonts
>
>  http://developer.apple.decenturl.com/human-interface-guidelines-text
>
> The "mini system font" is the typography of choice for text boxes, but
> it looks the "application font" is acceptable as well.
>
>> In any case, I think these differences are minor.
>
> I don't. :)
>
>> More importantly, I'm not sure that a different cross-platform
>> toolkit would do a better job.
>
> True, that. It's just that this doesn't mean that wxWidgets does a  
> very
> good job.
>
>
> Regards,
> apfelmus
>
> --
> http://apfelmus.nfshost.com
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners

Reply | Threaded
Open this post in threaded view
|

Re: Selecting a GUI toolkit

Daniel Carrera-4
In reply to this post by Peter Verswyvelen-2
Peter Verswyvelen wrote:
> I thought wxWidgets was actually one of the only toolkits that actually
> *used* the native GUI libraries???

It does, and while I'm no expert on the subject, my understanding is
that wxWidgets does the best job at matching the native UI. So far it
seems that the things wx doesn't get right are small. The most
significant difference I've seen so far is capitalization, and I'm not
sure that this is an issue with wxWidgets per se, because the other
screen shots on the wxWidgets site have the correct capitalization.

Daniel.
12