views:

225

answers:

4

Possible Duplicate:
Cross Platform C library for GUI Apps?

Is there any crossplatform GUI library for C language? (I mean at least win mac lin) If there is any XML-like GUI editing model, any GUI editing crossplatform visual programms it'l be grate!)

A: 

Tk is a GUI library written in C. It comes with a scripting language named Tcl. These can be embedded in your C program. They are very mature and relatively lightweight. You can call the GUI toolkit from C, though it's much easier to do your GUI in Tcl and import it into your C program.

Applications written in Tcl, Tk and C are highly portable, and easy to distribute. The language is BSD style, which is a lot more liberal than GNU licenses.

On the Mac and Windows, Tk uses native widgets whenever possible, making your apps look right for each of those platforms.

Bryan Oakley
Tcl and tk install loads of stuff on your windows setup, and it looks terribly outdated. ( like the screens in these screenshots: http://tuvalu.santafe.edu/%7Evince/alphatk/intro.html )
Toad
@Toad: Tcl and Tk only installs "loads of stuff" when you install a distribution from some place like ActiveState. When you are making your own C program that's another story. It is quite possible to have a single file executable that includes all of Tcl and Tk, as well as your app and any other libraries, images, sounds, etc. that you need in as little as a couple megs. As for looking dated, that's subjective and often isn't a factor. Tk uses native widgets on the Mac and on Windows, so the look is more a reflection of design skills rather than toolkit limitations.
Bryan Oakley
+1  A: 

I use Gtk a lot it is consistent and nice to use. It was formerly used as a common platform for Gimp but became widely used and is the base toolkit for the Gnome desktop under Linux.

The GUI editor I use is Glade under Linux. The code generated can be recompiled without change under Windows. GLib is an underlying library that abstracts files, network, provides basic types and collections. As long as you use Glib, you are mostly OS independent.

I forgot to mention that glade stores the user interface in XML and generates code out of it. On the glade page I saw there is a windows version there but I cannot tell much about its behaviour. Under Linux it's fairly OK to use and quite stable.

jdehaan
A: 

GTK is a cross-platform GUI for C (not C++, though there are wrappers for it and many languages).

Reed Copsey
A: 

Take a look at the IUP Toolkit. It is written largely in C, and is also easily bound to Lua.

RBerteig