[Gtk-sharp-list] UIManager focus

Piotr Zurek p.zurek at gmail.com
Wed Sep 13 00:04:46 EDT 2006


Hi there,

A small problem with focusing on UIManager-created widgets.
When I start the application, the first button on my toolbar has the 
focus. If I click anything else it grabs the focus and when I click 
again on one of the toolbar buttons it doesn't grab the focus back - the 
last previously widget remains focused. I can still move the focus 
around using TAB but seriously, that's not an option.
How can I force a toolbar button or menu item to grab the focus on a 
mouse click?
I tried:

uiManager.PreActivate += new PreActivateHandler (uiManager_PreActivate);

and then:

void uiManager_PreActivate (object o, PreActivateArgs args)
{
	toolbar.GrabFocus ();
	Console.WriteLine ("Toolbar focused");
}

The text is displayed but it doesn't grab the focus.

Cheers
piotr


More information about the Gtk-sharp-list mailing list