Switching Focus between child widgets



hi

i went through the source code and made a conclusion that only container
widgets can move the focus between its children. Is it so, or i m missing
something. 

I would also like to know if i want to make arrow key behave as tab key, how
it can be done.
I know that it can be done in application written using Gtk but i want to
make changes in Gtk source code.
I tried adding bindings to GDK_Right with move_focus signal and
GTK_DIR_TAB_FORWARD as direction but unable to get it done and i know that i
have done something terribly wrong but couldn't think of any other solution.
May be some one can provide a hint in this context. 

bye
varun 






muppet wrote:
> 
> 
> 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!
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
> 
> 

-- 
View this message in context: http://www.nabble.com/How-%22Tab%22-brings-widgets-into-focus-tf4101158.html#a11756812
Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com.




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