Re: Next, previous button????



>I don't really quite get you, Paul. Are there any examples which I can refer 
>to?

this is a brief summary. its not working code. if you don't understand
this, i suggest you take a while to do some more fun projects with
GTK+ until you understand it more.


  GtkWidget *notebook;     
  GtkWidget *frame1;
  GtkWidget *frame2;
  GtkButton *next_button;
  GtkButton *previous_button;

  notebook = gtk_notebook_new ();
  gtk_notebook_hide_tabs (GTK_NOTEBOOK(notebook));

  frame1 = gtk_frame_new (...);
  frame2 = gtk_frame_new (...);

  ... add contents to frames ...

  gtk_notebook_append_page (GTK_NOTEBOOK(notebook), frame1, "");
  gtk_notebook_append_page (GTK_NOTEBOOK(notebook), frame2, "");
  gtk_notebook_set_show_tabs (GTK_NOTEBOOK(notebook), FALSE);

  next_button = gtk_button_new ("Next");
  previous_button = gtk_button_new ("Previous");

  gtk_signal_connect(GTK_OBJECT(next_button), "clicked",
                     (GtkSignalFunc) next_clicked,
		     notebook);

  gtk_signal_connect(GTK_OBJECT(previous_button), "clicked",
                     (GtkSignalFunc) previous_clicked,
		     notebook);


void
next_clicked (GtkWidget *widget, gpointer *data)
{
    GtkWidget *notebook = (GtkWidget *) data;
    gtk_notebook_next_page (GTK_NOTEBOOK(notebook));
}

void
previous_clicked (GtkWidget *widget, gpointer *data)
{
    GtkWidget *notebook = (GtkWidget *) data;
    gtk_notebook_prev_page (GTK_NOTEBOOK(notebook));
}



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