Page 1 of 2

Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 8:21 pm
by Michael Sherwin
If someone with no experience other than writing a chess engine wanted to write a portable GUI for chess then what would be some good choices for a GUI toolkit and why? Think in terms of adequate, simple and easy to learn and not so much on bells and whistles. Also free would be nice!

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 9:17 pm
by Don
Michael Sherwin wrote:If someone with no experience other than writing a chess engine wanted to write a portable GUI for chess then what would be some good choices for a GUI toolkit and why? Think in terms of adequate, simple and easy to learn and not so much on bells and whistles. Also free would be nice!
I don't think there is anything simpler and easier than tcl/tk for this. If you want to write this in C you can still use the tk library. One huge advantage of tcl/tk is that it is extremely portable.

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 9:26 pm
by pgeorges
Portable : what are the targets ? If you include mobile sets, things get complicated.

On desktop PC, you have plenty of choices, among them the most obvious :
- Java
- C++ with Qt (wxWindows is worth considering)
- Tcl / Tk, Perl Tk (Tkinter), Python Tk, Python Qt, etc.

I don't think Air from Adobe is a good candidate. Of course forget about MS Silverlight.

All these are free for opensource development (for example Qt needs a licence to make commercial apps).

The best choice may be Java (free and easy to learn) : look at Jose Chess http://jose-chess.sourceforge.net/ which deserves to be continued.

Pascal Georges

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 10:15 pm
by Michael Sherwin
Thanks!

Wright or wrong this is what I understand so far.

Tcl is a scripting language and is interpreted, but you can make standalone executables by embedding the interpreter.

Tk is the actual GUI library that can be called from different languages including just plain C.

What I do not know is:

What is a scripting language? And how is it different than using an ide such as MSVS to write code using a procedural language like C?

Is Tcl just a language designed to use Tk or can it be used with out calling Tk functions?

Is 'scripting' and 'general purpose' mutually exclusive terms?

Can Tk be used with Lisp, PLT Scheme or Haskel?

Would it be just as easy to use Tk with C or would it be worth learning Tcl?

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 11:15 pm
by viriathus
I like http://www.wxwidgets.org/

wxWidgets is a C++ library that lets developers create applications for Windows, OS X, Linux and UNIX on 32-bit and 64-bit architectures as well as several mobile platforms including Windows Mobile, iPhone SDK and embedded GTK+. It has popular language bindings for Python, Perl, Ruby and many other languages. Unlike other cross-platform toolkits, wxWidgets gives its applications a truly native look and feel because it uses the platform's native API rather than emulating the GUI. It's also extensive, free, open-source and mature.

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 11:15 pm
by pgeorges
What is a scripting language? And how is it different than using an ide such as MSVS to write code using a procedural language like C?
The IDE is just a text editor plus fancy features (code completion, syntax highlighting, etc.). You have some either for scripting languages or compiled ones.
Is Tcl just a language designed to use Tk or can it be used with out calling Tk functions?
They fit well together, but Tk can be used with Tcl, Perl, Python, etc.
Is 'scripting' and 'general purpose' mutually exclusive terms?
No.
Can Tk be used with Lisp, PLT Scheme or Haskel?
If you consider those obsolete or marginal languages, portability and maintenance will be both an issue.
Would it be just as easy to use Tk with C or would it be worth learning Tcl?
Certainly it is worth learning Tcl. I use both Tcl and C++ for Scid, that relies on Tk toolkit. But Tcl is no longer a mainstream language. Java would be a better choice nowadays.

Pascal Georges[/quote]

Re: Which GUI toolkits are best?

Posted: Sat Jan 02, 2010 11:57 pm
by Steve Maughan
I'd always recommend Delphi (i.e. Visual Pascal). IMHO it's the best Windows Application development environment. Currently it's really only Win32 but that is likely to change "soon". The big advantage over many platforms is that it compiles into one single EXE.

While many C++ snobs will turn their noses up at Delphi, both Arena and Aquarium are Delphi based.

Best regards,

Steve

Re: Which GUI toolkits are best?

Posted: Sun Jan 03, 2010 11:07 am
by Gian-Carlo Pascutto
pgeorges wrote: All these are free for opensource development (for example Qt needs a licence to make commercial apps).
This hasn't been true for at least 6 months or so now. Qt is now LGPL instead of GPL, so no problem using it for commercial apps freely.

Re: Which GUI toolkits are best?

Posted: Sun Jan 03, 2010 11:25 am
by ilari
Steve Maughan wrote:I'd always recommend Delphi (i.e. Visual Pascal). IMHO it's the best Windows Application development environment. Currently it's really only Win32 but that is likely to change "soon".
Delphi is nice, and it's a complete solution for Windows development. But "soon" probably isn't good enough for someone who needs cross-platform compatibility "now".
The big advantage over many platforms is that it compiles into one single EXE.
Do you mean that it uses static linking? Most platforms can do that. But I still prefer dynamic linking because it's more flexible, eg. you can update components/libraries without recompiling the application.

Re: Which GUI toolkits are best?

Posted: Sun Jan 03, 2010 11:40 am
by ilari
For Cute Chess we use Qt, which is what I recommend for cross-platform (or even single-platform) development. If performance and memory usage are not that important, you may want to use Python (http://www.pyside.org/) instead of C++, especially if you're not familiar with C++. The Qt SDK is a complete package: compiler, libraries, debugger, IDE, documentation.