Skip navigation.

GUI for (shell-)script languages

GTK
GTK

For a long time I wanted to have access to GUI widgets while using shell scripts. I wanted to have something for Linux, similar to "dtksh" on CDE. The Gimp Toolkit was the best looking choice to me.

So my goal was to think of a way which enabled GUI access for multiple script languages. It had to be flexible, extendable, it had to give access to GTK 1.x and 2.x, and it had to be a feasable project. Finally I did not want to investigate other people's sourcecode to implement extra GUI commands.

The concept of a GTK server was born. The basic idea behind this concept is a binary, which can be started from within a script. The script has to communicate with this binary by using 2-way pipes (stdin/stdout) or by using sockets (tcp). The script sends original GTK commands as plain text to the pipe or the socket, and the gtk-server sends information back which must be captured by the script.

A problem was the callback mechanism. The GTK-SERVER has to keep track of callback signals. Right now, every time a widget is created, one callback signal per widget can be realized.

Another problem was the variable GTK function name. How to look up a GTK function whose name is held in an array of chars? And if this function was found, how to handle the variable amount of arguments, each of which may have a different type? This is where the configfile comes in. In the configfile the user has to describe the name of the function, the callbacksignal, the returnvalue, the amount of arguments and the type for each argument.

You can find the GTK-server here. Both Linux as Windows are supported.

My site includes demo script programs, precompiled GTK-server binaries as well as the sourcecode. I hope somebody of the GTK community find my efforts useful.

Cheers

Peter.

Re: Needed: a revolution in shell scripting

Yes yes yes !! You're definitely right IMO... If only "open-source people" were not as conservative as any other ones, we would already have got rid of these under-productive things... For sure they were quite nice at the time they appeared, but as you said we have so much powerful languages now...

I think there is a real need for a really innovative distribution these days : instead of including thouthands of oldy packages, this distro would select only state-of-the-art software (as much as possible of course). For example, it could get rid of all those usual initialization scripts written in shell, replacing them with equivalents written with a descent scripting language like Python...

F.B.