[linux-audio-dev] Re: a bit off topic: GUI-lib-programming (how does it usually work?)

Loki Davison loki.davison at gmail.com
Sun Mar 5 15:00:10 UTC 2006


On 3/6/06, Julien Claassen <julien at c-lab.de> wrote:
> Hi!
>   I know, this may be a bit off topic. But I've a dificulty:
>   I'm currently programming a textbase "GUI"-lib. I want the programming API
> to be similar to on of a real GUI-lib (gtk, you name them).
>   Now I'm wondering, there are menus. Menus have menuitems and if you click
> on
> one, something should happen. How is this "something should happen" part
> usually done?

It's done by registering a call back. In current gtk versions this is
done by having actions and they have a label and are associated with a
particular function. Using the python bindings
http://www.pygtk.org/pygtk2tutorial/sec-UIManager.html explains the
general idea for menus. There is an example there. All buttons etc in
gtk work the same i.e with call backs being registered.

Loki



More information about the Linux-audio-dev mailing list