summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.h
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1998-11-16 23:40:50 +0000
committerLars Hamann <lars@src.gnome.org>1998-11-16 23:40:50 +0000
commite94a7b1a7afe102d74f075e76f2674287f2d2153 (patch)
tree0c5091b244813b57859ab657573914fa1de5b7ec /gtk/gtknotebook.h
parent7e44eced8c7c01f60a1135f7de6bd2215d5a3967 (diff)
downloadgtk+-e94a7b1a7afe102d74f075e76f2674287f2d2153.tar.gz
new flags : homogeneous; new guints : tab_hborder, tab_vborder; marked
Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> * gtk/gtknotebook.h (struct _GtkNotebook): new flags : homogeneous; new guints : tab_hborder, tab_vborder; marked tab_border deprecated (struct _GtkNotebookPage): new flags : expand, fill, pack * gtk/gtknotebook.h/c (gtk_notebook_set_homogeneous_tabs): new function. set homogeneneous tabs (gtk_notebook_set_tab_border): set tab_h/vborder to tab_border (gtk_notebook_set_tab_hborder): new function. set tab_hborder (gtk_notebook_set_tab_vborder): new function. set tab_vborder (gtk_notebook_query_tab_label): new function. get tab_label widget. (gtk_notebook_set_tab_label): new function. set tab_label widget. (gtk_notebook_set_tab_label_text): new function. set tab_label text. (gtk_notebook_query_menu_label): new function. get tab_label widget. (gtk_notebook_set_menu_label): new function. set tab_label widget. (gtk_notebook_set_menu_label_text): new function. set tab_label text. (gtk_notebook_set_tab_label_packing): new function. set tab_label fill, expand, fill_type (gtk_notebook_query_tab_label_packing): new function. get tab_label fill, expand, fill_type (gtk_notebook_real_page_position): return logic page number (gtk_notebook_search_page) search next/prev logic page (gtk_notebook_update_labels): set logic page number. (gtk_notebook_page_compare): renamed gtk_notebook_find_page (gtk_notebook_set/get_child_arg): new args CHILD_ARG_TAB_EXPAND, CHILD_ARG_TAB_FILL, CHILD_ARG_TAB_PACK (gtk_notebook_button_press) (gtk_notebook_key_press) (gtk_notebook_focus) (gtk_notebook_pages_allocate) (gtk_notebook_calc_tabs) (gtk_notebook_switch_focus_tab) use gtk_notebook_search_page (gtk_notebook_page_allocate): fixed allocation bug (gtk_notebook_set/get_arg): new args TAB_HBORDER, TAB_VBORDER. (gtk_notebook_init): unset GTK_NO_WINDOW flag (gtk_notebook_size_request): check whether page->child is visible. changes due to tab h/vborder, homogeneous tabs (gtk_notebook_paint): don't draw invisible tabs (gtk_notebook_switch_page): calculate page_num if it's less than 0 (gtk_notebook_append_*) (gtk_notebook_prepend_*) (gtk_notebook_insert_page): removed sanity checks * gtk/testgtk.c (create_notebook): extended Notebook sample a bit.
Diffstat (limited to 'gtk/gtknotebook.h')
-rw-r--r--gtk/gtknotebook.h185
1 files changed, 126 insertions, 59 deletions
diff --git a/gtk/gtknotebook.h b/gtk/gtknotebook.h
index 013e08c2b0..ad049b9d10 100644
--- a/gtk/gtknotebook.h
+++ b/gtk/gtknotebook.h
@@ -35,6 +35,8 @@ extern "C" {
#define GTK_IS_NOTEBOOK(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_NOTEBOOK))
#define GTK_IS_NOTEBOOK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
+#define GTK_NOTEBOOK_PAGE(_glist_) ((GtkNotebookPage *)((GList *)(_glist_))->data)
+
typedef struct _GtkNotebook GtkNotebook;
typedef struct _GtkNotebookClass GtkNotebookClass;
@@ -54,16 +56,21 @@ struct _GtkNotebook
guint32 timer;
- guint16 tab_border;
+ guint16 tab_border; /* deprecated field,
+ * use tab_hborder, tab_vborder instead
+ */
+ guint16 tab_hborder;
+ guint16 tab_vborder;
- guint show_tabs : 1;
- guint show_border : 1;
- guint tab_pos : 2;
- guint scrollable : 1;
- guint in_child : 2;
- guint click_child : 2;
- guint button : 2;
- guint need_timer : 1;
+ guint show_tabs : 1;
+ guint homogeneous : 1;
+ guint show_border : 1;
+ guint tab_pos : 2;
+ guint scrollable : 1;
+ guint in_child : 2;
+ guint click_child : 2;
+ guint button : 2;
+ guint need_timer : 1;
guint child_has_focus : 1;
};
@@ -81,62 +88,122 @@ struct _GtkNotebookPage
GtkWidget *child;
GtkWidget *tab_label;
GtkWidget *menu_label;
+
guint default_menu : 1;
guint default_tab : 1;
+ guint expand : 1;
+ guint fill : 1;
+ guint pack : 1;
+
GtkRequisition requisition;
GtkAllocation allocation;
};
-
-GtkType gtk_notebook_get_type (void);
-GtkWidget* gtk_notebook_new (void);
-void gtk_notebook_append_page (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label);
-void gtk_notebook_append_page_menu (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label,
- GtkWidget *menu_label);
-void gtk_notebook_prepend_page (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label);
-void gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label,
- GtkWidget *menu_label);
-void gtk_notebook_insert_page (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label,
- gint position);
-void gtk_notebook_insert_page_menu (GtkNotebook *notebook,
- GtkWidget *child,
- GtkWidget *tab_label,
- GtkWidget *menu_label,
- gint position);
-void gtk_notebook_remove_page (GtkNotebook *notebook,
- gint page_num);
-gint gtk_notebook_current_page (GtkNotebook *notebook);
-gint gtk_notebook_page_num (GtkNotebook *notebook,
- GtkWidget *child);
-void gtk_notebook_set_page (GtkNotebook *notebook,
- gint page_num);
-void gtk_notebook_next_page (GtkNotebook *notebook);
-void gtk_notebook_prev_page (GtkNotebook *notebook);
-void gtk_notebook_reorder_child (GtkNotebook *notebook,
- GtkWidget *child,
- gint position);
-void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
- GtkPositionType pos);
-void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
- gboolean show_tabs);
-void gtk_notebook_set_show_border (GtkNotebook *notebook,
- gint show_border);
-void gtk_notebook_set_scrollable (GtkNotebook *notebook,
- gint scrollable);
-void gtk_notebook_set_tab_border (GtkNotebook *notebook,
- guint border_width);
-void gtk_notebook_popup_enable (GtkNotebook *notebook);
-void gtk_notebook_popup_disable (GtkNotebook *notebook);
+/***********************************************************
+ * Creation, insertion, deletion *
+ ***********************************************************/
+
+GtkType gtk_notebook_get_type (void);
+GtkWidget * gtk_notebook_new (void);
+void gtk_notebook_append_page (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label);
+void gtk_notebook_append_page_menu (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label,
+ GtkWidget *menu_label);
+void gtk_notebook_prepend_page (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label);
+void gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label,
+ GtkWidget *menu_label);
+void gtk_notebook_insert_page (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label,
+ gint position);
+void gtk_notebook_insert_page_menu (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label,
+ GtkWidget *menu_label,
+ gint position);
+void gtk_notebook_remove_page (GtkNotebook *notebook,
+ gint page_num);
+
+/***********************************************************
+ * query, set current NoteebookPage *
+ ***********************************************************/
+
+gint gtk_notebook_current_page (GtkNotebook *notebook);
+gint gtk_notebook_page_num (GtkNotebook *notebook,
+ GtkWidget *child);
+void gtk_notebook_set_page (GtkNotebook *notebook,
+ gint page_num);
+void gtk_notebook_next_page (GtkNotebook *notebook);
+void gtk_notebook_prev_page (GtkNotebook *notebook);
+
+/***********************************************************
+ * set Notebook, NotebookTab style *
+ ***********************************************************/
+
+void gtk_notebook_set_show_border (GtkNotebook *notebook,
+ gboolean show_border);
+void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
+ gboolean show_tabs);
+void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
+ GtkPositionType pos);
+void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
+ gboolean homogeneous);
+void gtk_notebook_set_tab_border (GtkNotebook *notebook,
+ guint border_width);
+void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
+ guint tab_hborder);
+void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
+ guint tab_vborder);
+void gtk_notebook_set_scrollable (GtkNotebook *notebook,
+ gboolean scrollable);
+
+/***********************************************************
+ * enable/disable PopupMenu *
+ ***********************************************************/
+
+void gtk_notebook_popup_enable (GtkNotebook *notebook);
+void gtk_notebook_popup_disable (GtkNotebook *notebook);
+
+/***********************************************************
+ * query/set NotebookPage Properties *
+ ***********************************************************/
+
+GtkWidget * gtk_notebook_query_tab_label (GtkNotebook *notebook,
+ GtkWidget *child);
+void gtk_notebook_set_tab_label (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *tab_label);
+void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
+ GtkWidget *child,
+ gchar *tab_text);
+GtkWidget * gtk_notebook_query_menu_label (GtkNotebook *notebook,
+ GtkWidget *child);
+void gtk_notebook_set_menu_label (GtkNotebook *notebook,
+ GtkWidget *child,
+ GtkWidget *menu_label);
+void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
+ GtkWidget *child,
+ gchar *menu_text);
+void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
+ GtkWidget *child,
+ gboolean *expand,
+ gboolean *fill,
+ GtkPackType *pack_type);
+void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook,
+ GtkWidget *child,
+ gboolean expand,
+ gboolean fill,
+ GtkPackType pack_type);
+void gtk_notebook_reorder_child (GtkNotebook *notebook,
+ GtkWidget *child,
+ gint position);
#ifdef __cplusplus
}