diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore index 622da335ed..e21801899e 100644 --- a/docs/reference/gtk/tmpl/.gitignore +++ b/docs/reference/gtk/tmpl/.gitignore @@ -16,6 +16,7 @@ gtkimcontextsimple.sgml gtkimmulticontext.sgml gtklinkbutton.sgml gtkmessagedialog.sgml +gtknotebook.sgml gtkobject.sgml gtkorientable.sgml gtkpagesetupunixdialog.sgml diff --git a/docs/reference/gtk/tmpl/gtknotebook.sgml b/docs/reference/gtk/tmpl/gtknotebook.sgml deleted file mode 100644 index 25035b1cab..0000000000 --- a/docs/reference/gtk/tmpl/gtknotebook.sgml +++ /dev/null @@ -1,709 +0,0 @@ - -GtkNotebook - - -A tabbed notebook container - - - -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 notebook 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_popup_enable(), gtk_notebook_popup_disable()) - - - -GtkNotebook as GtkBuildable - -The GtkNoteboopk implementation of the GtkBuildable interface -supports placing children into tabs by specifying "tab" as the -"type" attribute of a <child> element. Note that the content -of the tab must be created before the tab can be filled. -A tab child can be specified without specifying a <child> -type attribute. - - -To add a child widget in the notebooks action area, specify -"action-start" or "action-end" as the "type" attribute of the <child> -element. - - -A UI definition fragment with GtkNotebook - - - - Content - - - - - Tab - - - -]]> - - - - - - - -#GtkContainer -For functions that apply to every #GtkContainer - - - - - - - - - - - - - - - - - - - - - -@notebook: the object which received the signal. -@arg1: -@Returns: - - - - - - -@notebook: the object which received the signal. -@widget: -@arg1: -@arg2: -@Returns: - - - - - - -@notebook: the object which received the signal. -@arg1: -@Returns: - - - - - - -@notebook: the object which received the signal. -@arg1: - - - - - - -@notebook: the object which received the signal. -@widget: -@arg1: - - - - - - -@notebook: the object which received the signal. -@widget: -@arg1: - - - - - - -@notebook: the object which received the signal. -@widget: -@arg1: - - - - - - -@notebook: the object which received the signal. -@arg1: -@Param3: -@Returns: - - - - - - -@notebook: the object which received the signal. -@arg1: -@Returns: - - - -Emitted when the user or a function changes the current page. - - -@notebook: the object which received the signal. -@page: the new current page -@page_num: the index of the page - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deprecated: 2.20: The tab packing functionality of children should not - be used anymore and support will be removed in the future. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@void: -@Returns: - - - - - - -@notebook: -@child: -@tab_label: -@Returns: - - - - - - -@notebook: -@child: -@tab_label: -@menu_label: -@Returns: - - - - - - -@notebook: -@child: the -@tab_label: -@Returns: - - - - - - -@notebook: -@child: -@tab_label: -@menu_label: -@Returns: - - - - - - -@notebook: -@child: -@tab_label: -@position: -@Returns: - - - - - - -@notebook: -@child: -@tab_label: -@menu_label: -@position: -@Returns: - - - - - - -@notebook: -@page_num: - - - - - - -@notebook: -@child: -@Returns: - - - - - - -@notebook: - - - - - - -@notebook: - - - - - - -@notebook: -@child: -@position: - - - - - - -@notebook: the notebook widget -@pos: the position - - - - - - -@notebook: -@show_tabs: - - - - - - -@notebook: -@show_border: - - - - - - -@notebook: -@scrollable: - - - - - - -@notebook: - - - - - - -@notebook: - - - - - - -@notebook: the notebook widget -@Returns: the page number - - - - - - -@notebook: -@child: -@Returns: - - - - - - -@notebook: -@page_num: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - -@notebook: -@child: -@Returns: - - - - - - -@notebook: -@child: -@menu_label: - - - - - - -@notebook: -@child: -@menu_text: - - - - - - -@notebook: -@child: -@tab_label: - - - - - - -@notebook: -@child: -@tab_text: - - - - - - - -@notebook: -@child: -@reorderable: - - - - - - - -@notebook: -@child: -@detachable: - - - - - - - -@notebook: -@child: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@child: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@child: -@Returns: - - - - - - - -@notebook: -@child: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@page_num: - - - - - - - -@notebook: -@group: - - - - - - - -@notebook: -@Returns: - - - - - - - -@notebook: -@widget: -@pack_type: - - - - - - - -@notebook: -@pack_type: -@Returns: - - - - -A function used by GtkNotebook when a detachable tab is dropped -in the root window, it's used to create a window containing a notebook -where the tab will be attached. This function will also be responsible -of moving/resizing the window and adding the necessary properties to -the notebook (i.e.: group-id). - -If the function returns %NULL, the drag will be cancelled. - - -@source: The source #GtkNotebook of the drag operation -@page: the child #GtkWidget affected -@x: the X coordinate where the drop happens -@y: the Y coordinate where the drop happens -@data: user data -@Returns: The created #GtkNotebook where the tab will be attached, or NULL to cancel the drag - - - - - - - -@func: -@data: -@destroy: - - diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 6bc6b1f9b7..58b6a4d370 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -45,6 +45,60 @@ #include "gtkdnd.h" #include "gtkbuildable.h" + +/** + * SECTION:gtknotebook + * @Short_description: A tabbed notebook container + * @Title: GtkNotebook + * @See_also: #GtkContainer + * + * 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 notebook 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_popup_enable(), gtk_notebook_popup_disable()) + * + * + * GtkNotebook as GtkBuildable + * + * The GtkNotebook implementation of the #GtkBuildable interface + * supports placing children into tabs by specifying "tab" as the + * "type" attribute of a <child> element. Note that the content + * of the tab must be created before the tab can be filled. + * A tab child can be specified without specifying a <child> + * type attribute. + * + * + * To add a child widget in the notebooks action area, specify + * "action-start" or "action-end" as the "type" attribute of the <child> + * element. + * + * + * A UI definition fragment with GtkNotebook + * + * + * + * Content + * + * + * + * + * Tab + * + * + * + * ]]> + * + * + */ + + #define SCROLL_DELAY_FACTOR 5 #define SCROLL_THRESHOLD 12 #define DND_THRESHOLD_MULTIPLIER 4 @@ -685,6 +739,13 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("Whether the child's tab should fill the allocated area"), TRUE, GTK_PARAM_READWRITE)); + + /** + * GtkNotebook:tab-pack: + * + * Deprecated: 2.20: The tab packing functionality of children should not + * be used anymore and support will be removed in the future. + */ gtk_container_class_install_child_property (container_class, CHILD_PROP_TAB_PACK, g_param_spec_enum ("tab-pack", @@ -819,6 +880,14 @@ gtk_notebook_class_init (GtkNotebookClass *class) 0, GTK_PARAM_READABLE)); + /** + * GtkNotebook::switch-page: + * @notebook: the object which received the signal. + * @page: the new current page + * @page_num: the index of the page + * + * Emitted when the user or a function changes the current page. + */ notebook_signals[SWITCH_PAGE] = g_signal_new (I_("switch-page"), G_TYPE_FROM_CLASS (gobject_class), diff --git a/gtk/gtknotebook.h b/gtk/gtknotebook.h index 553a4840d9..ef862dc8ed 100644 --- a/gtk/gtknotebook.h +++ b/gtk/gtknotebook.h @@ -58,9 +58,9 @@ typedef struct _GtkNotebookClass GtkNotebookClass; struct _GtkNotebook { + /* */ GtkContainer container; - /* */ GtkNotebookPrivate *priv; };