[gtkmm] possible to reconnect accelGroup keys?



Hello everyone. 

I have an application that must use standard keys like GDK_space, GDK_p, etc. 
to trigger some callbacks. This all works fine. But in the app, there is a 
treeview with editable CellRendererText cells. Since the GDK_space, for 
instance, has been pirated away as an accelerator, I can't enter spaces into 
the cellrenderer. 

So, I overrode Gtk::CellRendererText via a derived class that nabs 
start_editing_vfunc(...). Now, the moment an edit starts on a cell, the 
following executes:

Gtk::CellEditable * derivedCellRendererText::start_editing_vfunc(
GdkEvent *event, 
Gtk::Widget & widget, 
const Glib::ustring & path,
const Gdk::Rectangle&background_area, 
const Gdk::Rectangle & cell_area,
Gtk::CellRendererState flags)   
{
	Glib::RefPtr <Gtk::AccelGroup> accels = mainwin->get_accel_group ();
	accels->disconnect_key (GDK_space, (Gdk::ModifierType)0);
	// call the base function
	Gtk::CellEditable * ce = Gtk::CellRendererText::start_editing_vfunc(event, 
widget, path, background_area, cell_area, flags);
	return ce;
}

This disconnects the GDK_space accelerator just fine, and spaces can be 
entered into the cell. 

How to reconnect it?
-- 
Kipp A. Aldrich
Light Saver Digital
kipp lightsaverhd com




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