Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GUI programming in Scala

I'm trying to learn Scala, and I'd like to learn by writing a simple swing app, but I'm unsure what GUI programing looks like in a functional world, and specifically when using Scala.

Any pointers, or tutorials, or gotchas when coming from an OO/Java background would be really welcome.

like image 514
thatismatt Avatar asked Jun 11 '09 14:06

thatismatt


People also ask

What is GUI programming?

graphical user interface (GUI), a computer program that enables a person to communicate with a computer through the use of symbols, visual metaphors, and pointing devices.

What is Scala and swing?

The scala-swing event system follows a different approach than the underlying Java system. Instead of adding event listeners with a particular interface (such as java. awt. ActionListener ), a Reactor instance announces the interest in receiving events by calling listenTo for a Publisher .

Does C++ use GUI?

The C++ standard library does not contain any GUI functions as Java or C# do, but there are many useful external libraries that you can install.

Can you write a GUI in C?

You can't write modern GUI applications, as it will only produce 16-bit code. All modern operating systems are 32-bit, and many are now 64-bit.


1 Answers

The Programming in Scala book did contain an overview of the scala-swing project. The book is very good, overall, and worth the money as a general reference, and sounds just like what you're looking for.

Scala-swing is a "wrapping" library approach, so, I wouldn't call it functional, really. State is mutated all over the place, mostly because that's just how Swing works.

I'm not really aware of many "free as in beer" resources for this topic yet, and I think the Syngeca scala wiki probably lists some preliminary approaches that became scala-swing, but, that's just a guess. :)

like image 86
Tristan Juricek Avatar answered Oct 04 '22 03:10

Tristan Juricek