Re: Focus on Switching Pages
- From: Ken Steen <ksteen earthlink net>
- To: gtk-app-devel-list gnome org
- Subject: Re: Focus on Switching Pages
- Date: Wed, 10 Jan 2001 12:22:47 -0700
I've got a GTK program I'm working on that uses a bunch of notebook pages to
display network connection related stuff. (A MU* client) Each page has a
zvt_term and text entry widget on it. Is there an easy way to focus on the text
entry widget every time the user changes the page?
Just connect to the page switch event.
gtk-signal-connect(GTK_OBJECT(notebook), "switch-page",
GTK_SIGNAL_FUNC(notebook_cb), NULL);
Then in the notebook function have the entry grab the focus.
void
notebook_cb(GtkNotebook *notebook, GtkNotebookPage *page,
gint page_num, gpointer data)
{
gtk_widget_grab_focus(GTK_WIDGET(your_entry_widget);
/* If the entry has text in it you might need to set
* the position of the cursor.
*/
gtk_editable_set_position(GTK_EDITABLE(your_entry_widget), 0);
}
Ken
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]