Re: How "Tab" brings widgets into focus

On Jul 18, 2007, at 9:02 AM, varun_shrivastava wrote:

so which of the GtkWidget "focus" signal handler is being called the default
one or the overridden one in GtkContainer class.

An overridden handler always gets called, and has the option to chain up to the default.

gtk_container_focus() handles two cases: 1) the container itself can take focus, and 2) the container cannot take focus, but perhaps its children can. The point of overriding this method for a container, then, is to pass the focus on to a child.

set-focus-child is a container-specific method to allow container implementations to control which child of the container has or will get focus. In gtk_container_focus_move(), the focus_child is used as the start point for finding the next item in the focus chain.

For example:

   focus chain:   A, B, C, D
   focus child:  B

gtk_container_focus_move(forward) will see that the current focus child is B, and focus C next.

So, set-focus-child is not involved in the call chain resulting from the user hitting the Tab key, but instead can be used by a widget to control programmatically what widget in a specific container will get focus when the user does hit the Tab key.

me, while driving the car: Okay, girls, what do you want for lunch?
yvonne: I wan' noo-tulls!
zella: I want lavaloli!  Can we go to the lavaloli store?
me: Um, where *is* the ravioli store?
zella: At the lavaloli store!
yvonne: I want noo-tulls!  Let's go to the noo-tull store!

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