Re: TreeView and default widget



David NeÄas (Yeti) wrote:
On Sun, Jun 04, 2006 at 12:07:17PM +0200, Attilio Fiandrotti wrote:

In my interface i have a button which grabs default focus like this

GTK_WIDGET_SET_FLAGS (GTK_WIDGET(my_button), GTK_CAN_DEFAULT);
gtk_widget_grab_default (button)

so that it gets activated when the user presses enter key,
and i also have a Treeview which grabs focus like this

gtk_widget_grab_focus(view)

so that the user can scroll the list without tabbing into it.
Obviously, when the treeview is active, the enter key no longer activates the button and the user has to tab over it and press space or enter to activate it. Is there a solution for this that doesn't require dealing with key_press_event signal?


I suppose the treeview is completely passive when the user
can press Enter and nothing is supposed to happen in the
treeview itself.  Then you can connect to its
"row-activated" signal and handle it as activation of the
button.

Your supposition is correct, and today i'll test this trick that may solve my problem.

thanks

Attilio



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