Forum: Ruby-Gnome 2 Setting focus to child widget on notebook switch-page

Posted by Steve Gibson (Guest)
on 2010-02-16 15:56
(Received via mailing list)
I have a notebook widget with several pages.  The pages each have a few
child widgets, one of which is a Gtk::Entry.  When I switch to a page I
would like focus to switch to the Gtk::Entry widget.  I've got a handler
that is successfully executing on the switch-page signal but I'm not 
sure
how to get the focus to move to my entry widget so I can start typing
without having to manually click it.  Any help appreciated.
Posted by Simon Arnaud (Guest)
on 2010-02-16 17:09
(Received via mailing list)
2010/2/16 Steve Gibson <steve@stevegibson.com>:
> I have a notebook widget with several pages.  The pages each have a few
> child widgets, one of which is a Gtk::Entry.  When I switch to a page I
> would like focus to switch to the Gtk::Entry widget.  I've got a handler
> that is successfully executing on the switch-page signal but I'm not sure
> how to get the focus to move to my entry widget so I can start typing
> without having to manually click it.  Any help appreciated.

Did you try Gtk::Wigdet#grab_focus ?

Simon
Posted by Steve Gibson (Guest)
on 2010-02-16 17:55
(Received via mailing list)
Thanks Simon.  That's what I needed.  Sorry for the silly question.

-Steve
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.