GTK+ Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
"tab-pos" GtkPositionType : Read / Write "show-tabs" gboolean : Read / Write "show-border" gboolean : Read / Write "scrollable" gboolean : Read / Write "tab-border" guint : Write "tab-hborder" guint : Read / Write "tab-vborder" guint : Read / Write "page" gint : Read / Write "enable-popup" gboolean : Read / Write "homogeneous" gboolean : Read / Write |
"tab-label" gchararray : Read / Write "menu-label" gchararray : Read / Write "position" gint : Read / Write "tab-expand" gboolean : Read / Write "tab-fill" gboolean : Read / Write "tab-pack" GtkPackType : Read / Write |
"change-current-page" void user_function (GtkNotebook *notebook, gint arg1, gpointer user_data); "focus-tab" gboolean user_function (GtkNotebook *notebook, GtkNotebookTab arg1, gpointer user_data); "move-focus-out" void user_function (GtkNotebook *notebook, GtkDirectionType arg1, gpointer user_data); "select-page" gboolean user_function (GtkNotebook *notebook, gboolean arg1, gpointer user_data); "switch-page" void user_function (GtkNotebook *notebook, GtkNotebookPage *page, gint page_num, gpointer user_data); |
The GtkNotebook widget is a GtkContainer whose children are pages that can be switched between using tab labels along one edge.
There are many configuration options for GtkNotebook. Among other things, you can choose on which edge the tabs appear (see gtk_notebook_set_tab_pos()), whether, if there are too many tabs to fit the noteobook should be made bigger or scrolling arrows added (see gtk_notebook_set_scrollable), and whether there will be a popup menu allowing the users to switch pages. (see gtk_notebook_enable_popup(), gtk_noteobook_disable_popup())
struct GtkNotebookPage; |
The GtkNotebookPage is an opaque implementation detail of GtkNotebook.
GtkWidget* gtk_notebook_new (void); |
Creates a new GtkNotebook widget with no pages.
Returns : | the newly created GtkNotebook |
void gtk_notebook_append_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label); |
Appends a page to notebook.
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
void gtk_notebook_append_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label); |
Appends a page to notebook, specifying the widget to use as the label in the popup menu.
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
menu_label : | the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a GtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label; If tab_label is not a GtkLabel, menu_label must be specified if the page-switch menu is to be used. |
void gtk_notebook_prepend_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label); |
Prepends a page to notebook.
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
void gtk_notebook_prepend_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label); |
Prepends a page to notebook, specifying the widget to use as the label in the popup menu.
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
menu_label : | the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a GtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label; If tab_label is not a GtkLabel, menu_label must be specified if the page-switch menu is to be used. |
void gtk_notebook_insert_page (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, gint position); |
Insert a page into notebook at the given position
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
position : | the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages. |
void gtk_notebook_insert_page_menu (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label, GtkWidget *menu_label, gint position); |
Insert a page into notebook at the given position, specifying the widget to use as the label in the popup menu.
notebook : | a GtkNotebook |
child : | the GtkWidget to use as the contents of the page. |
tab_label : | the GtkWidget to be used as the label for the page, or NULL to use the default label, 'page N'. |
menu_label : | the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a GtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label; If tab_label is not a GtkLabel, menu_label must be specified if the page-switch menu is to be used. |
position : | the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages. |
void gtk_notebook_remove_page (GtkNotebook *notebook, gint page_num); |
Removes a page from the notebook given its index in the notebook.
notebook : | a GtkNotebook. |
page_num : | the index of a notebook page, starting from 0. If -1, the last page will be removed. |
#define gtk_notebook_current_page gtk_notebook_get_current_page |
Warning |
gtk_notebook_current_page is deprecated and should not be used in newly-written code. |
Deprecated compatibility macro. Use gtk_notebook_get_current_page() instead.
gint gtk_notebook_page_num (GtkNotebook *notebook, GtkWidget *child); |
Finds the index of the page which contains the given child widget.
notebook : | a GtkNotebook |
child : | a GtkWidget |
Returns : | the index of the page containing child, or -1 if child is not in the notebook. |
#define gtk_notebook_set_page gtk_notebook_set_current_page |
Warning |
gtk_notebook_set_page is deprecated and should not be used in newly-written code. |
Deprecated compatibility macro. Use gtk_notebook_set_current_page() instead.
void gtk_notebook_next_page (GtkNotebook *notebook); |
Switches to the next page. Nothing happens if the current page is the last page.
notebook : | a GtkNotebook |
void gtk_notebook_prev_page (GtkNotebook *notebook); |
Switches to the previous page. Nothing happens if the current page is the first page.
notebook : | a GtkNotebook |
void gtk_notebook_reorder_child (GtkNotebook *notebook, GtkWidget *child, gint position); |
Reorders the page containing child, so that it appears in position position. If position is greater than or equal to the number of children in the list or negative, child will be moved to the end of the list.
notebook : | a GtkNotebook |
child : | the child to move |
position : | the new position, or -1 to move to the end |
void gtk_notebook_set_tab_pos (GtkNotebook *notebook, GtkPositionType pos); |
Sets the edge at which the tabs for switching pages in the notebook are drawn.
notebook : | a GtkNotebook. |
pos : | the edge to draw the tabs at. |
void gtk_notebook_set_show_tabs (GtkNotebook *notebook, gboolean show_tabs); |
Sets whether to show the tabs for the notebook or not.
notebook : | a GtkNotebook |
show_tabs : | TRUE if the tabs should be shown. |
void gtk_notebook_set_show_border (GtkNotebook *notebook, gboolean show_border); |
Sets whether a bevel will be drawn around the notebook pages. This only has a visual effect when the tabs are not shown. See gtk_notebook_set_show_tabs().
notebook : | a GtkNotebook |
show_border : | TRUE if a bevel should be drawn around the notebook. |
void gtk_notebook_set_scrollable (GtkNotebook *notebook, gboolean scrollable); |
Sets whether the tab label area will have arrows for scrolling if there are too many tabs to fit in the area.
notebook : | a GtkNotebook |
scrollable : | TRUE if scroll arrows should be added |
void gtk_notebook_set_tab_border (GtkNotebook *notebook, guint border_width); |
Warning |
gtk_notebook_set_tab_border is deprecated and should not be used in newly-written code. |
Sets the width the border around the tab labels in a notebook. This is equivalent to calling gtk_notebook_set_tab_hborder (notebook, border_width) followed by gtk_notebook_set_tab_vborder (notebook, border_width).
notebook : | a GtkNotebook |
border_width : | width of the border around the tab labels. |
void gtk_notebook_popup_enable (GtkNotebook *notebook); |
Enables the popup menu: if the user clicks with the right mouse button on the bookmarks, a menu with all the pages will be popped up.
notebook : | a GtkNotebook |
void gtk_notebook_popup_disable (GtkNotebook *notebook); |
Disables the popup menu.
notebook : | a GtkNotebook |
gint gtk_notebook_get_current_page (GtkNotebook *notebook); |
Returns the page number of the current page.
notebook : | a GtkNotebook |
Returns : | the index (starting from 0) of the current page in the notebook. If the notebook has no pages, then -1 will be returned. |
GtkWidget* gtk_notebook_get_menu_label (GtkNotebook *notebook, GtkWidget *child); |
Retrieves the menu label widget of the page containing child.
notebook : | a GtkNotebook |
child : | a widget contained in a page of notebook |
Returns : | the menu label, or NULL if the notebook page does not have a menu label other than the default (the tab label). |
GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook, gint page_num); |
Returns the child widget contained in page number page_num.
notebook : | a GtkNotebook |
page_num : | the index of a page in the noteobok |
Returns : | the child widget, or NULL if page_num is out of bounds. |
GtkWidget* gtk_notebook_get_tab_label (GtkNotebook *notebook, GtkWidget *child); |
Returns the tab label widget for the page child. NULL is returned if child is not in notebook or if no tab label has specifically been set for child.
notebook : | a GtkNotebook |
child : | the page |
Returns : | the tab label |
void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook, GtkWidget *child, gboolean *expand, gboolean *fill, GtkPackType *pack_type); |
Query the packing attributes for the tab label of the page containing child.
notebook : | a GtkNotebook |
child : | the page |
expand : | location to store the expand value (or NULL) |
fill : | location to store the fill value (or NULL) |
pack_type : | location to store the pack_type (or NULL) |
void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook, gboolean homogeneous); |
Warning |
gtk_notebook_set_homogeneous_tabs is deprecated and should not be used in newly-written code. |
Sets whether the tabs must have all the same size or not.
notebook : | a GtkNotebook |
homogeneous : | TRUE if all tabs should be the same size. |
void gtk_notebook_set_menu_label (GtkNotebook *notebook, GtkWidget *child, GtkWidget *menu_label); |
Changes the menu label for the page containing child.
notebook : | a GtkNotebook |
child : | the child widget |
menu_label : | the menu label, or NULL for default |
void gtk_notebook_set_menu_label_text (GtkNotebook *notebook, GtkWidget *child, const gchar *menu_text); |
Creates a new label and sets it as the menu label of child.
notebook : | a GtkNotebook |
child : | the child widget |
menu_text : | the label text |
void gtk_notebook_set_tab_hborder (GtkNotebook *notebook, guint tab_hborder); |
Warning |
gtk_notebook_set_tab_hborder is deprecated and should not be used in newly-written code. |
Sets the width of the horizontal border of tab labels.
notebook : | a GtkNotebook |
tab_hborder : | width of the horizontal border of tab labels. |
void gtk_notebook_set_tab_label (GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label); |
Changes the tab label for child. If NULL is specified for tab_label, then the page will have the label 'page N'.
notebook : | a GtkNotebook |
child : | the page |
tab_label : | the tab label widget to use, or NULL for default tab label. |
void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook, GtkWidget *child, gboolean expand, gboolean fill, GtkPackType pack_type); |
Sets the packing parameters for the tab label of the page containing child. See gtk_box_pack_start() for the exact meaning of the parameters.
notebook : | a GtkNotebook |
child : | the child widget |
expand : | whether to expand the bookmark or not |
fill : | whether the bookmark should fill the allocated area or not |
pack_type : | the position of the bookmark |
void gtk_notebook_set_tab_label_text (GtkNotebook *notebook, GtkWidget *child, const gchar *tab_text); |
Creates a new label and sets it as the tab label for the page containing child.
notebook : | a GtkNotebook |
child : | the page |
tab_text : | the label text |
void gtk_notebook_set_tab_vborder (GtkNotebook *notebook, guint tab_vborder); |
Warning |
gtk_notebook_set_tab_vborder is deprecated and should not be used in newly-written code. |
Sets the width of the vertical border of tab labels.
notebook : | a GtkNotebook |
tab_vborder : | width of the vertical border of tab labels. |
G_CONST_RETURN gchar* gtk_notebook_get_menu_label_text (GtkNotebook *notebook, GtkWidget *child); |
Retrieves the text of the menu label for the page containing child.
notebook : | a GtkNotebook |
child : | the child widget of a page of the notebook. |
Returns : | value: the text of the tab label, or NULL if the widget does not have a menu label other than the default menu label, or the menu label widget is not a GtkLabel. The string is owned by the widget and must not be freed. |
gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook); |
Returns whether the tab label area has arrows for scrolling. See gtk_notebook_set_scrollable().
notebook : | a GtkNotebook |
Returns : | TRUE if arrows for scrolling are present |
gboolean gtk_notebook_get_show_border (GtkNotebook *notebook); |
Returns whether a bevel will be drawn around the notebook pages. See gtk_notebook_set_show_border().
notebook : | a GtkNotebook |
Returns : | TRUE if the bevel is drawn |
gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook); |
Returns whether the tabs of the notebook are shown. See gtk_notebook_set_show_tabs().
notebook : | a GtkNotebook |
Returns : | TRUE if the tabs are shown |
G_CONST_RETURN gchar* gtk_notebook_get_tab_label_text (GtkNotebook *notebook, GtkWidget *child); |
Retrieves the text of the tab label for the page containing child.
notebook : | a GtkNotebook |
child : | a widget contained in a page of notebook |
Returns : | value: the text of the tab label, or NULL if the tab label widget is not a GtkLabel. The string is owned by the widget and must not be freed. |
GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook); |
Gets the edge at which the tabs for switching pages in the notebook are drawn.
notebook : | a GtkNotebook |
Returns : | the edge at which the tabs are drawn |
void gtk_notebook_set_current_page (GtkNotebook *notebook, gint page_num); |
Switches to the page number page_num.
notebook : | a GtkNotebook |
page_num : | index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the notebook, nothing will be done. |
Which side of the notebook holds the tabs
Whether tabs should be shown or not
Whether the border should be shown or not
If TRUE, scroll arrows are added if there are too many tabs to fit
Width of the border around the tab labels
Width of the horizontal border of tab labels
Width of the vertical border of tab labels
The index of the current page
If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page
Whether tabs should have homogeneous sizes
The string displayed on the childs tab label
The string displayed in the childs menu entry
The index of the child in the parent
Whether to expand the childs tab or not
Wheather the childs tab should fill the allocated area or not
A GtkPackType indicating whether the child is packed with reference to the start or end of the parent
void user_function (GtkNotebook *notebook, gint arg1, gpointer user_data); |
gboolean user_function (GtkNotebook *notebook, GtkNotebookTab arg1, gpointer user_data); |
void user_function (GtkNotebook *notebook, GtkDirectionType arg1, gpointer user_data); |
gboolean user_function (GtkNotebook *notebook, gboolean arg1, gpointer user_data); |
void user_function (GtkNotebook *notebook, GtkNotebookPage *page, gint page_num, gpointer user_data); |
Emitted when the user or a function changes the current page.