Re: GtkNotebook signal: switch_page



On Thu, 10 Aug 2000 alaric@portone.com wrote:

> 
> I cannot seem to get the switch_page signal to work at all in my
> application.  Hrmm...
> 
> Just as a simple test I have connected a callback to that signal on one of
> my notebooks with a simple printf statement... and nothing happens when I
> switch tabs within the interface...

  Most probably you don't see output of your handlers because of the IO
buffering. Just add "\n" to the end of printf format string, so libc will
flush buffers after each printf call. 
 
> Any help would be greatly appreciated.
> 
> 
> Leeman Strout
> alaric@portone.com
> 
> here's the relevant stuff...
> 
> 
> interface.c:   
> notebook1 = gtk_notebook_new ();
> gtk_widget_set_name (notebook1, "notebook1");
> gtk_widget_ref (notebook1);
> gtk_object_set_data_full (GTK_OBJECT (bfgmj), "notebook1", notebook1,
>                           (GtkDestroyNotify) gtk_widget_unref);
> gtk_widget_show (notebook1);
> gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
> 
> 
> 
> gtk_signal_connect (GTK_OBJECT (notebook1), "switch_page",
>                     GTK_SIGNAL_FUNC (notebook1_switch_page),
>                     GTK_NOTEBOOK(notebook1));
> 
> 
> callbacks.c:
> 
> void
> notebook1_switch_page                  (GtkNotebook     *notebook,
>                                         GtkNotebookPage *page,
>                                         gint             page_num,
>                                         gpointer         user_data)
> { gint i;
>   i = gtk_notebook_get_current_page (GTK_NOTEBOOK(user_data));
>   printf ("current page: %d", i);
> }
> 
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

 Best regards,
  -Vlad





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]