A Gtk_Notebook is a container that displays all of its children at the same location on the screen. They are organized into pages, that can be selected through tabs (either by clicking on them or by a contextual menu). This is the best way to organize complicated interfaces that have a lot of widgets, by putting the children into groups of coherent widgets.
You can hide some of the pages of the notebook by simply calling Hide on the widget that is contained in the page (or returned from Get_Nth_Page).
Widget Hierarchy |
---|
GObject (see section Package Glib.Object) Gtk_Object (see section Package Gtk.Object) \___ Gtk_Widget (see section Package Gtk.Widget) \___ Gtk_Container (see section Package Gtk.Container) \___ Gtk_Notebook (see section Package Gtk.Notebook) |
Signals |
---|
Types |
---|
subtype Gtk_Notebook_Page is Gtk.Gtk_Notebook_Page; | |
| |
type Gtk_Notebook_Tab is (Notebook_Tab_First, Notebook_Tab_Last); | |
|
Subprograms |
---|
Creating a notebook and inserting pages | ||
procedure Gtk_New (Widget : out Gtk_Notebook); | ||
Create a new empty notebook.
| ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Notebook.
| ||
procedure Append_Page (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Insert a new page in Notebook. | ||
procedure Append_Page (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Same as above, but no label is specified.
| ||
procedure Append_Page_Menu (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Insert a new page in Notebook. | ||
procedure Prepend_Page (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Insert a new page in Notebook. | ||
procedure Prepend_Page_Menu (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Insert a new page in Notebook. | ||
procedure Insert_Page (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; Position : Gint); | ||
Insert a new page at a specific position in Notebook. | ||
procedure Insert_Page_Menu (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class; Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class; Position : Gint); | ||
Insert a new page at a specific position in Notebook. | ||
procedure Remove_Page (Notebook : access Gtk_Notebook_Record; Page_Num : Gint); | ||
Remove a page from the notebook. | ||
Modifying and getting the current page | ||
function Get_Current_Page (Notebook : access Gtk_Notebook_Record) return Gint; | ||
Get the number of the current page. | ||
function Get_Nth_Page (Widget : access Gtk_Notebook_Record'Class; Page_Num : Gint) return Gtk.Widget.Gtk_Widget; | ||
Convert from a page number to the real page.
| ||
function Page_Num (Widget : access Gtk_Notebook_Record'Class; Child : access Gtk.Widget.Gtk_Widget_Record'Class) return Gint; | ||
Convert from a child to a page number. | ||
procedure Set_Current_Page (Notebook : access Gtk_Notebook_Record; Page_Num : in Gint := -1); | ||
Modify the current page.
Note: This call won't succeeded unless you have called Show on the
widget displayed in the page.
| ||
procedure Set_Page (Notebook : access Gtk_Notebook_Record; Page_Num : in Gint := -1); | ||
| ||
procedure Next_Page (Notebook : access Gtk_Notebook_Record); | ||
Display the next page on the screen.
| ||
procedure Prev_Page (Notebook : access Gtk_Notebook_Record); | ||
Display the previous page on the screen.
| ||
Style and visual aspect | ||
procedure Set_Show_Border (Notebook : access Gtk_Notebook_Record; Show_Border : Boolean := True); | ||
Indicate whether the notebook should display borders. | ||
function Get_Show_Border (Notebook : access Gtk_Notebook_Record) return Boolean; | ||
Return whether the notebook displays borders.
| ||
procedure Set_Show_Tabs (Notebook : access Gtk_Notebook_Record; Show_Tabs : Boolean := True); | ||
Indicate whether the tabs should be displayed. | ||
function Get_Show_Tabs (Notebook : access Gtk_Notebook_Record) return Boolean; | ||
Return whether the tabs are displayed.
| ||
procedure Set_Tab_Pos (Notebook : access Gtk_Notebook_Record; Pos : Gtk.Enums.Gtk_Position_Type); | ||
Change the position of the tabs. | ||
function Get_Tab_Pos (Widget : access Gtk_Notebook_Record) return Gtk.Enums.Gtk_Position_Type; | ||
Return the current position of the tabs.
| ||
procedure Set_Scrollable (Notebook : access Gtk_Notebook_Record; Scrollable : in Boolean := True); | ||
Indicate whether Notebook display scrolling arrows when there are | ||
function Get_Scrollable (Notebook : access Gtk_Notebook_Record) return Boolean; | ||
Return whether Notebook is scrollable. | ||
Popup Menu | ||
The pages of a notebook can be selected both via tabs and a contextual | ||
procedure Popup_Enable (Notebook : access Gtk_Notebook_Record); | ||
Enable the popup menu. | ||
procedure Popup_Disable (Notebook : access Gtk_Notebook_Record); | ||
Disable the popup menu. | ||
Page properties | ||
function Get_Tab_Label (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class) return Gtk.Widget.Gtk_Widget; | ||
Return the widget displayed in the tab used to select Page. | ||
procedure Set_Tab_Label (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Modify the widget displayed in the tab for the page that contains Child. | ||
procedure Set_Tab_Label_Text (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Tab_Text : UTF8_String); | ||
Modify the text displayed in the tab for the page that contains Child. | ||
function Get_Tab_Label_Text (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String; | ||
Return the text displayed in the tab for the page that contains Child.
| ||
procedure Set_Tab (Notebook : access Gtk_Notebook_Record; Page_Num : Gint; Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Set Notebook tab widget for a given page number. | ||
function Get_Menu_Label (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class) return Gtk.Widget.Gtk_Widget; | ||
Return the widget displayed in the contextual menu for the Child. | ||
procedure Set_Menu_Label (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Modify the widget displayed in the contextual menu for the page | ||
procedure Set_Menu_Label_Text (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Menu_Text : UTF8_String); | ||
Modify the text displayed in the contextual menu for the page that | ||
function Get_Menu_Label_Text (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class) return UTF8_String; | ||
Return the text displayed in the contextual menu for the page that | ||
procedure Query_Tab_Label_Packing (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Expand : out Boolean; Fill : out Boolean; Pack_Type : out Gtk.Enums.Gtk_Pack_Type); | ||
Return the packing used for the tab associated with the page | ||
procedure Set_Tab_Label_Packing (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Expand : Boolean; Fill : Boolean; Pack_Type : Gtk.Enums.Gtk_Pack_Type); | ||
Modify the packing used for the tab associated with the page that | ||
procedure Reorder_Child (Notebook : access Gtk_Notebook_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class; Position : Gint); | ||
Change the position of the page that contains Child.
| ||
List of pages | ||
function Get_Children (Widget : access Gtk_Notebook_Record) return Page_List.Glist; | ||
Return the list of all pages in the notebook.
| ||
GValue support | ||
function Get_Notebook_Page (Value : Glib.Values.GValue) return Gtk_Notebook_Page; | ||
Convert a Value into a notebook page.
|