Part 5a

Gtk Notebook

GtkNotebook

  1. Open up tutorial-3.glade and save as tutorial-5.glade. Now remove the label from the center of the vertical container and add a Notebook container.

    Your project should look like this now.

    images/glade-05-01.png
  2. Add a label to each tab in the notebook. If the tab is empty it will not show up when you run the program. Note you have to click on the edge of the tab to select the tab.

    Your project should look like this now.

    images/glade-05-02.png
  3. Now double click on File > New on your Menu Bar to select the gtk_new menu item. Change the Name: to gtk_new.

    images/glade-05-03.png
  4. In the Signals tab add the on_gtk_new_activate signal handler to the activate signal and don’t forget to press the enter key after picking it in the drop down box. If you don’t see the drop down box you may have to scroll to the right a little.

    Your project should look like this now.

    images/glade-05-04.png
  5. Select the notebook and add the on_notebook1_switch_page signal handler.

    Your project should look like this now.

    images/glade-05-05.png

Save the project as tutorial-5.glade and we are done with the glade part.

To ask questions about this tutorial use the Feedback Forum