[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to make a hook function and call from C?
From: |
joakim |
Subject: |
how to make a hook function and call from C? |
Date: |
Thu, 08 May 2008 22:44:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
I want to call lisp inside a gtk widget signal handler:
------------------------------------------------
xw->widget=GTK_WIDGET(gtk_button_new_with_label ( xw->title));
g_signal_connect (G_OBJECT (xw->widget), "clicked", G_CALLBACK (hello),
xw);
...
static void hello( GtkWidget *widget,
gpointer data )
{
printf ("button clicked %d\n",data);
Lisp_Object args[2];
struct xwidget* xw=( struct xwidget*)data;
/* FIXME i have no particular idea how to call lisp yet
args[0] = data->message_hook;
args[1] = arg;
Ffuncall (2, args);
*/
// call0(intern("xwidget-dummy-hook")); //crashes even if fn exists
// call0(intern("beep")); //"beep" seems to not crash and not do anything
but "info" crashes
}
-----------------------------------------------
When I click the button, the "hello" function is reached, but
I cant figure out how to call a lisp function.
- Are there any similar examples in the codebase somewhere?
- I would like xw->message_hook to contain a lisp hook, settable from the
lisp level. How do I set this up at the C level?
- Should I use Ffuncall to call my new hook or what?
--
Joakim Verona