On 3/6/06, Julien Claassen <[EMAIL PROTECTED]> 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
