[Gllug] graphical interface
Pete Ryland
pdr at createservices.com
Fri Mar 11 10:27:20 UTC 2005
On Mon, Mar 07, 2005 at 11:30:54AM +0000, Tethys wrote:
>
> "J F" writes:
>
> >I wrote a console-based C program recently that I intend to share
> >with my colleagues. However, they're having a hard time getting to
> >grips with it, complaining it's not very 'user friendly'. So I want
> >to give it a graphical interface, but I don't know how I should go
> >about this.
> >
> >Should I try GTK? I'm not much of a programmer... would it be
> >difficult to learn? Also, my colleagues use Mac OS X, would I be able
> >to port it, using GTK?
>
> There are two obvious solutions to this. The elegant way, and the quick
> and dirty way.
>
> The elegant way is to separate your engine from your interface.
> [...]
>
> The quick and dirty way is just to write a GUI in a scripting language,
> [...]
Or somewhere in between these two, create a module to a scripting language
and write a gui in said language. For example, re-write your program as a
library (still in C), and create python bindings for it - this can be done
almost automagically if you use something like swig[1]. Then just go and
write your gui and console interfaces in python. That way, the guts of the
program are still in a compiled language, and only the ui parts (which don't
normally require much speed) are in the scripting language.
It all actually depends on what sort of program it is anyway.
Pete
[1] http://swig.sourceforge.net/
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list