Re: Using AbiWidget

From: Teus Benschop <teus_at_teusbenschop.nl>
Date: Fri Mar 09 2007 - 12:36:35 CET

Hi Martin,

Thanks for your kind words to a newcomer.

The problem was that the Ctrl-O shortcuts actually allows the user to
open a file in the widget and once this new file was loaded, the
abiwidget stopped emitting any signals. Hence I was looking for a method
to override this shortcut.

The hack found later was an unusual one, yet it worked: connect to the
signal before the widget is shown:

 libabiword_init(argc, (const char **)argv);
 abi = abi_widget_new ();
 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);

I hope that this is a permanent hack and not something that might
disappear in later versions of Gtk.

Does the abiwidget have its own way to disable keybindings, or are we
stuck with this hack?

Regards,

Teus.

msevior@physics.unimelb.edu.au wrote:
>
> Hi Tues,
> Thanks for your interest in AbiWord and particularly libabiword. I
> suggest you direct these sort of technical questions to the
> development mailing list here:
>
> abiword-dev@abisource.com
>
> Cheers!
>
> Martin
>
>
>> 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.
>>
>>
>
>
>
>
>
>
Received on Fri Mar 9 12:36:00 2007

This archive was generated by hypermail 2.1.8 : Fri Mar 09 2007 - 12:36:01 CET