[pygtk] Questions about accelerators.

James Henstridge james@daa.com.au
Fri, 29 Sep 2000 11:30:40 +0800 (WST)


On Thu, 28 Sep 2000, Dave Belfer-Shevett wrote:

> Hey folks.  I sent this to glade-users, and perhaps its more appropriate
> for this list.  Any ideas?
> 
> -------------------.   Web-based problem management: www.stonekeep.com
> Dave Belfer-Shevett >----------------------------------------------------.
> shevett@pobox.com  /    My idea of an agreeable person is a person who    \
> ------------------<          agrees with me. (Benjamin Disreali)           |
>                    \______________________________________________________/
> 
> ---------- Forwarded message ----------
> Date: Thu, 28 Sep 2000 16:09:38 -0400 (EDT)
> From: Dave Belfer-Shevett <shevett@homeport.org>
> To: glade-users@helixcode.com
> Subject: Questions about accelerators.
> 
> 
> Hi folks.  I'm writing a GTK app using libglade in Python.  So far thinks
> are going okay, but I'm having some difficulty connecting accelerators and
> trapping signals from them.
> 
> I've defined an accelerator within a GtkText widget (call it 'ctrl-f1'),
> and bound it to the key.  I save it, and in the Glade file, I have:
> 
> [shevett@cheetah]:~/python/spanker/proj1$ ./spanker.py
> 
> Gtk-WARNING **: gtk_accel_group_add(): could not find signal "ctrl-f1"in
> the `GtkText' class ancestry
> 
> Gtk-WARNING **: gtk_signal_connect_full(): could not find signal
> "enter" in the `GtkText' class ancestry
> 
> Okay, fine, that means I need to use a signal that exists.  (I
> think).  But what I -rally- want to do is link 'Ctrl-f1' to the 'clicked'
> signal on a button elsewhere.  
> 
> How do I do this - specifically in python/Glade.  :)

This is not pygtk problem.  You can't just invent signal names like
that.  Accelerators have to activate an existing signal on an object.  If
you just want to catch some other key presses on a particular widget, then
connect to its key_press_event signal, and handle the key presses there.

> 
> Thanks!

James.

-- 
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/