Re: How Tab brings widgets into focus

2007-07-18 Thread varun_shrivastava

hi,
so is it like when i press tab key, move_focus signal is emitted, and as
its a signal of GtkWindow class. it has a default handler
gtk_window_move_focus: which internally calls gtk_widget_child_focus(),
which actually emits focus signal of GtkWidget. This signal also has a
default handler gtk_widget_real_focus()
which calls gtk_widget_grab_focus.

But when i looked through the gtkcontainer.c code i found that GtkWidget
focus signal handler has been overridden to gtk_container_focus and also
has its own set_focus_child signal handler as
gtk_container_real_set_focus_child. Or gtk_container signal
set_focus_child is being emitted.

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



David Nečas (Yeti)-2 wrote:
 
 On Tue, Jul 17, 2007 at 10:25:42PM -0700, varun_shrivastava wrote:
 
 i tried to find out how pressing Tab key brings widgets into focus, but
 couldn;t find out.
 
 Start at the end of gtk_window_class_init() where
 add_arrow_bindings() and add_tab_bindings() are called and
 follow from there...  
 
 I went through the add_arrow_bindings and add_tab_bindings i under stood
 the flow but not thoroughly,
 GtkBindingSet *binding contains GtkBindingEntry *entry which contains
 GtkBindingSignal *signal and in while loop it stores signal information in
 entry structure.
 
 but i didn't find this bindings structure being used after its initialized
 in gtk_window_class_init(). 
 
 
 
 
 it should lead you to places such as
 gtk_container_focus().
 
 Yeti
 
 --
 http://gwyddion.net/
 ___
 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#a11668199
Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com.

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How Tab brings widgets into focus

2007-07-18 Thread muppet

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


Re: How Tab brings widgets into focus

2007-07-18 Thread varun_shrivastava

thanks

but one doubt still remains about GtkBindingSet structure which was
initialized at the time of gtk_window_class_init, where its being used or
how its being used?




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#a11682233
Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com.

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How Tab brings widgets into focus

2007-07-17 Thread Daniel Kasak
On Tue, 2007-07-17 at 22:25 -0700, varun_shrivastava wrote:

 hi
 i tried to find out how pressing Tab key brings widgets into focus, but
 couldn;t find out.
 
 For eg if i have created three spin button widget and are held by a
 container VBox.
 then pressing tab key switches b/w the spin buttons. I looked through the
 source code of gtkspinbutton, but couldn't find where key press event
 related to Tab key is being handled.

This behaviour probably ( I'm guessing a bit here ) inherits from
GtkWidget.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How Tab brings widgets into focus

2007-07-17 Thread Yeti
On Tue, Jul 17, 2007 at 10:25:42PM -0700, varun_shrivastava wrote:
 
 i tried to find out how pressing Tab key brings widgets into focus, but
 couldn;t find out.

Start at the end of gtk_window_class_init() where
add_arrow_bindings() and add_tab_bindings() are called and
follow from there...  it should lead you to places such as
gtk_container_focus().

Yeti

--
http://gwyddion.net/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list