Ok, I found the hack: Just connect the key_press_event signal before the
abiwidget is shown, like this:
libabiword_init(argc, (const char **)argv);
abi = abi_widget_new ();
/* The key press event must be connected at this stage, else the
widget absorbs every event */
g_signal_connect (G_OBJECT (abi), "key_press_event", G_CALLBACK
(on_key_press_event), NULL);
gtk_container_add (GTK_CONTAINER (window), abi);
gtk_widget_show_all (window);
Teus.
Teus Benschop wrote:
>
> Hello,
>
> I've been looking around the internet for any examples of programs
> that use the abiwidget. There is one example on
> http://www.abiword.org/twiki/bin/view/Abiword/AbiWordSDK, and that was
> very helpful.
>
> But there is something I do not yet know how to solve. The AbiWidget
> has its own keybindings. I'd like to override these. For example,
> Ctrl-B now switches bold on. How to override this so that Ctrl-B no
> longer does that?
>
> I connected to the GtkWkidget's "key_press_event", like so:
>
> static gboolean on_key_press_event (GtkWidget * widget, GdkEventKey *
> event, gpointer user_data)
> {
> g_print ("Key pressed");
> return FALSE;
> }
>
> g_signal_connect (G_OBJECT (abi), "key_press_event", G_CALLBACK
> (on_key_press_event), NULL);
>
>
> But to no avail. The keybinding was still there. Setting the return
> value to TRUE makes no difference.
>
> Any help on overriding the keybindings is greatly appreciated.
>
> Teus.
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abiword-user-request@abisource.com with the word
> unsubscribe in the message body.
>
>
>
-----------------------------------------------
To unsubscribe from this list, send a message to
abiword-user-request@abisource.com with the word
unsubscribe in the message body.
Received on Fri Mar 9 11:41:18 2007
This archive was generated by hypermail 2.1.8 : Fri Mar 09 2007 - 11:41:18 CET