rem: if ( page ) { gtk_notebook_set_current_page ( preference_frame, page-1 ); }
context: void preferences ( gint page ){  GtkWidget *tree, *right, *w, *vbox, *hbox, *hbox2, *separator,    *button_ok, *button_cancel;  GtkTreeIter iter, iter2;  GtkTreePath * path;  /* Create dialog */  fenetre_preferences = gtk_dialog_new ();  gtk_dialog_add_buttons (GTK_DIALOG(fenetre_preferences), 			  GTK_STOCK_HELP,  GTK_RESPONSE_HELP,			  GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,			  NULL);  gtk_window_set_title ( GTK_WINDOW ( fenetre_preferences ),			 _("Grisbi setup") );  /* Create List & Tree for topics */  tree = create_preferences_tree();    hpaned = gtk_hpaned_new();  gtk_paned_add1(GTK_PANED(hpaned), tree);  hbox = gtk_hbox_new ( FALSE, 0 );  gtk_paned_add2(GTK_PANED(hpaned), hbox);  gtk_box_pack_start ( GTK_BOX ( hbox ), gtk_label_new ( "    " ),		       FALSE, FALSE, 0 ); /* FIXME: ugly! */  /* Frame for preferences */  preference_frame = GTK_NOTEBOOK ( gtk_notebook_new () );  gtk_notebook_set_show_border ( preference_frame, FALSE );  gtk_notebook_set_show_tabs  ( preference_frame, FALSE );  gtk_notebook_set_scrollable ( preference_frame, TRUE );  gtk_box_pack_start ( GTK_BOX ( hbox ), GTK_WIDGET(preference_frame),		       TRUE, TRUE, 0 );  /* File tab */  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter, NULL);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter,		      0, _("Files"),		      1, FILES_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_fichier(), NULL);  /* Display subtree */  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter, NULL);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter,		      0, _("Display"),		      1, NOT_A_PAGE,		      -1);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Messages & warnings"),		      1, MESSAGES_AND_WARNINGS_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_messages_and_warnings(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Addresses & titles"),		      1, ADDRESSES_AND_TITLES_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_display_addresses(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Transaction form"),		      1, TRANSACTION_FORM_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_display_transaction_form(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Transactions list cells"),		      1, TRANSACTIONS_LIST_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_affichage_liste(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Transactions list"),		      1, TRANSACTIONS_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, 			    GTK_WIDGET(onglet_affichage_operations()), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Reconciliation"),		      1, RECONCILIATION_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, tab_display_reconciliation(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Fonts & logo"),		      1, FONTS_AND_LOGO_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_display_fonts(), NULL);  /* Resources subtree */  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter, NULL);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter,		      0, _("Resources"),		      1, NOT_A_PAGE,		      -1);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Currencies"),		      1, CURRENCIES_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_devises(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Banks"),		      1, BANKS_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_banques(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Financial years"),		      1, FINANCIAL_YEARS_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_exercices(), NULL);  gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);  gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),		      &iter2,		      0, _("Payment methods"),		      1, METHODS_OF_PAYMENT_PAGE,		      -1);  gtk_notebook_append_page (preference_frame, onglet_types_operations(), NULL);  if ( page )    {      gtk_notebook_set_current_page ( preference_frame, page-1 );    }  gtk_widget_show_all ( hpaned );  gtk_container_set_border_width ( GTK_CONTAINER(hpaned), 6 );  gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(fenetre_preferences) -> vbox ), 		       hpaned, TRUE, TRUE, 0);  while ( 1 )    {      switch (gtk_dialog_run ( GTK_DIALOG ( fenetre_preferences ) ))	{	case GTK_RESPONSE_CLOSE:	  gtk_widget_destroy ( GTK_WIDGET ( fenetre_preferences ));	  return;	case GTK_RESPONSE_HELP:	  break;	}    }}