Arun wrote:

>>>    The widget was GnomeEntry
>>>    Problem is i dont know what the next widget is, if that is known
>>>I could have requested a grabfocus.
>>>
>>I repeat, why not use the "activate" signal which triggers on enter?
>>
>
>
>here is how -
>
>    What i want is a focus change on Enter key press.
>
>    Consider i got hbox with two widgets. first one is Gnome entry.
>I am connecting a handler to 'active'. In the handler i want to change the
>focus to next widget. But i dont have reference to the same. How 
>will i change the focus ? 
>
Try passing the widget you want to transfer focus to as an argument to 
the signal handler:

  entry1 = gtk.GtkEntry()
  entry2 = gtk.GtkEntry()
  def transfer_focus(widget, other_widget):
       other_widget.grab_focus()
  entry1.connect('activate', transfer_focus, entry2)

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/




_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to