Re: Focus on Notebook tab
- From: Cesc <cesc santa gmail com>
- To: sadheeskumar gmail com
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Focus on Notebook tab
- Date: Fri, 9 Sep 2005 15:34:28 +0200
Hi there,
Is it a problem of the page not getting selected or it just won't be
refreshed on the screen?
I had a problem with set_current_page() not refreshing the screen correctly:
the page would be actually set correctly, but it just would not display
correctly till you forced it to refresh (for example, minimize and
maximize).
The problem was with set_current_page being called from outside gtk_main
loop. I solved it by passing a command to the dispatcher (i use glibs
dispatcher) and then execute the set_current_page from within the main_loop
... it works flawless now.
Hope it helps,
Cesc
On 9/9/05, sadhees kumar <sadheeskumar gmail com> wrote:
Friends,
I am using GtkNotebook widget, it has 7 pages.i want to navigate all the
pages.In my project i am using GDK_Tab key
for navigating to next page. This is done in the GtkNotebook widget's
"keypress" callback function.
The problem is i'm not getting the focus in the notebook tab(or page
label).Foucus is on the child widget in that page.
how can i bring the focus to the notebook tab(page label)?
Thanks in advance...
code is as follows,
gboolean on_notebook1_key_press_event (GtkWidget *widget, GdkEventKey
*event, gpointer user_data)
{
int a;
if(event->keyval == GDK_Tab)
{
a = gtk_notebook_get_current_page((GtkNotebook *)notebook1);
if (a < 6)
gtk_notebook_next_page((GtkNotebook *)notebook1);
else if (a == 6)
gtk_notebook_set_current_page((GtkNotebook *)notebook1,0);
}
if(event->keyval == GDK_Left)
{
a = gtk_notebook_get_current_page((GtkNotebook *)notebook1);
if (a > 0)
gtk_notebook_prev_page((GtkNotebook *)notebook1);
else if (a == 0)
gtk_notebook_set_current_page((GtkNotebook *)notebook1,6);
}
return FALSE;
}
Regards,
K.Sadheeskumar
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]