Which GUI toolkits are best?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Which GUI toolkits are best?

Post by Michael Sherwin » Sat Jan 02, 2010 7:21 pm

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 hate if statements. Pawns demand if statements. Therefore I hate pawns.

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Which GUI toolkits are best?

Post by Don » Sat Jan 02, 2010 8:17 pm

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.

pgeorges

Re: Which GUI toolkits are best?

Post by pgeorges » Sat Jan 02, 2010 8:26 pm

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

Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Which GUI toolkits are best?

Post by Michael Sherwin » Sat Jan 02, 2010 9:15 pm

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?
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

viriathus
Posts: 32
Joined: Tue Dec 15, 2009 11:35 pm

Re: Which GUI toolkits are best?

Post by viriathus » Sat Jan 02, 2010 10:15 pm

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.

pgeorges

Re: Which GUI toolkits are best?

Post by pgeorges » Sat Jan 02, 2010 10:15 pm

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]

User avatar
Steve Maughan
Posts: 1061
Joined: Wed Mar 08, 2006 7:28 pm
Location: Florida, USA
Contact:

Re: Which GUI toolkits are best?

Post by Steve Maughan » Sat Jan 02, 2010 10:57 pm

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

Gian-Carlo Pascutto
Posts: 1184
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Re: Which GUI toolkits are best?

Post by Gian-Carlo Pascutto » Sun Jan 03, 2010 10:07 am

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.

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: Which GUI toolkits are best?

Post by ilari » Sun Jan 03, 2010 10:25 am

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.

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: Which GUI toolkits are best?

Post by ilari » Sun Jan 03, 2010 10:40 am

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.

Post Reply