> In Emacs low-level code, callbacks are not really used. Instead events > are generated, that get handled by the Emacs event loop that eventually > will result in Lisp code being called. > > Good. We need a mechanism common for tabs of console, gtk, motif. The best starting point is to start thinking from GTK notebook widget, because it is easy to insert in emacs, and it is already well known. > I use this technique in my xwidget branch, where GTK components can be > embedded in an Emacs buffer. The GTK widgets then register GTK callback > signals that in turn generate Emacs events, that then get handled by the > Emacs message loop. You then use the normal message map to bind lisp to your event. > I do not think we need to catch all GTK events, like mouse passing over a widget. > Initially I had the misconception that the callback should call Lisp > directly, but that didn't work out well. Thankfully I was pointed in the > right direction by emacs-devel. > > In my opinion, fot tabs at least, at C level , the callbacks should do nothing, apart from calling lisp function associated to that events ...