How to grab focus to the first entry field into a notebook page

View: New views
2 Messages — Rating Filter:   Alert me  

How to grab focus to the first entry field into a notebook page

by AngeloP :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a
    GtkNotebook with 3 pages
        into every page there is a Gtkalignment
               into Gtkalignment there is GtkEntry or an Object that contains GtkEntry

I would know how to grab_focus on the first GtkEntry of one page when the page becomes
current page

Have one some idea ??

Thanks

Re: How to grab focus to the first entry field into a notebook page

by kksou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

AngeloP wrote:
I have a
    GtkNotebook with 3 pages
        into every page there is a Gtkalignment
               into Gtkalignment there is GtkEntry or an Object that contains GtkEntry

I would know how to grab_focus on the first GtkEntry of one page when the page becomes
current page
Hi,

- Store the pointer to the GtkEntry associated with each of the page in an array.

- When the user clicks a new tab, just use $entry[$tab]->grab_focus()

Here's a complete sample code:

http://www.kksou.com/php-gtk2/articles/grab-focus-on-GtkEntry-in-a-GtkNotebook-page---Part-1---highlight-all-text-on-focus.php

Regards.
/kksou