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.
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.
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 .
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.
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.
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. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With