[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabs are ready? -> Let us give a definition of tabs.

From: joakim
Subject: Re: Tabs are ready? -> Let us give a definition of tabs.
Date: Sun, 05 Feb 2012 23:30:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Alin Soare <address@hidden> writes:

>     >> ... and what is a "standard event" in this context?  And why
>     can a
>     >> toolbar button not react to such a standard event in the same
>     way?
>     >
>     >
>     > Initialize tab, hide tab, show tab, kill tab, at least.
>     I don't understand that yet.  For me an event is a user action
>     like
>     hitting a key or moving the mouse.  The type of that action and
>     any
>     additional information are communicated by the OS to Emacs which
>     reacts
>     to the event by executing some action (or doing nothing).
>      Initializing
>     or hiding a tab is in my opinion an action performed by Emacs
>     itself,
>     possibly in reaction to an event or triggered by a timer.
> In graphocal contexts , like GTK / motif programming, the concept of
> 'event has almost nothing to do with the concept of UNIX signal.
> Initializing a tab is not an action performed by emacs, but it is what
> you define it to be.
> In gtk for example, if you insert a gtk-notebook widget in emacs, you
> write the callback functions in C , such that they call elisp function
> of that signals.

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.

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.

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.

Joakim Verona

reply via email to

[Prev in Thread] Current Thread [Next in Thread]