Gtk.Notebook Class
Notebook widget container.

See Also: Notebook Members

Syntax

[System.Reflection.DefaultMember("Item")]
public class Notebook : Container

Remarks

The Notebook widget is a Gtk.Container whose children are pages that can be switched between using tabs along the edge. Tabs are typically Gtk.Label widgets, but can be any other widget.

There are many configuration options for Notebooks. Among other things, you can choose on which edge the tabs appear (The Notebook.TabPos property), whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added (The Notebook.Scrollable property), and whether there will be a popup menu allowing the users to switch pages (The Notebook.EnablePopup property).

Notebooks without tabs, can be used as containers to quickly switch between different groups of information to reduce any flicker caused by widget relayout by the application.

C# Example

using System;
using Gtk;

class NotebookSample
{
	static void Main ()
	{
		new NotebookSample ();
	}

	NotebookSample ()
	{
		Application.Init ();
		Window win = new Window ("NotebookSample");
		win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
		win.SetDefaultSize (400, 400);
		
		Notebook nb = new Notebook ();
		for (int i = 0; i < 5; i ++)
		{
			string label = String.Format ("Page {0}", i+1);
			nb.AppendPage (new Button (label), new Label (label));
		}

		win.Add (nb);
		win.ShowAll ();
		Application.Run ();
	}

	void OnWinDelete (object obj, DeleteEventArgs args)
	{
		Application.Quit ();
	}
} 
  
(FIXME: all methods in this class should specify types in their param elements, and this doc needs a good proofreading.)

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: 2.12.0.0