2006-02-23 17:59:33 +00:00
|
|
|
|
/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
|
2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* GTK+ at ftp:ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:37:18 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2008-06-17 19:29:22 +00:00
|
|
|
|
|
2011-01-04 17:21:41 +00:00
|
|
|
|
#include "gtknotebook.h"
|
2008-06-17 19:29:22 +00:00
|
|
|
|
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkbindings.h"
|
|
|
|
|
#include "gtkbox.h"
|
|
|
|
|
#include "gtkbuildable.h"
|
|
|
|
|
#include "gtkbutton.h"
|
|
|
|
|
#include "gtkcssstylepropertyprivate.h"
|
|
|
|
|
#include "gtkdnd.h"
|
|
|
|
|
#include "gtkdragdest.h"
|
|
|
|
|
#include "gtkeventcontrollermotion.h"
|
|
|
|
|
#include "gtkgesturemultipress.h"
|
|
|
|
|
#include "gtkgizmoprivate.h"
|
|
|
|
|
#include "gtkiconprivate.h"
|
|
|
|
|
#include "gtkintl.h"
|
|
|
|
|
#include "gtklabel.h"
|
1998-02-19 05:13:46 +00:00
|
|
|
|
#include "gtkmain.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
1998-02-19 05:13:46 +00:00
|
|
|
|
#include "gtkmenu.h"
|
|
|
|
|
#include "gtkmenuitem.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkorientable.h"
|
|
|
|
|
#include "gtksizerequest.h"
|
|
|
|
|
#include "gtkstylecontextprivate.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkstack.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2012-03-16 19:01:50 +00:00
|
|
|
|
#include "gtkwidgetpath.h"
|
2012-03-21 08:37:09 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
|
2011-07-01 02:11:13 +00:00
|
|
|
|
#include "a11y/gtknotebookaccessible.h"
|
2008-06-17 19:29:22 +00:00
|
|
|
|
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <math.h>
|
2010-10-03 17:50:11 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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())
|
|
|
|
|
*
|
2014-02-05 02:00:58 +00:00
|
|
|
|
* # GtkNotebook as GtkBuildable
|
2014-02-02 05:29:00 +00:00
|
|
|
|
*
|
2010-10-03 17:50:11 +00:00
|
|
|
|
* The GtkNotebook implementation of the #GtkBuildable interface
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* supports placing children into tabs by specifying “tab” as the
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* “type” attribute of a <child> element. Note that the content
|
2010-10-03 17:50:11 +00:00
|
|
|
|
* of the tab must be created before the tab can be filled.
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* A tab child can be specified without specifying a <child>
|
2010-10-03 17:50:11 +00:00
|
|
|
|
* type attribute.
|
2010-10-04 00:05:45 +00:00
|
|
|
|
*
|
2010-10-03 17:50:11 +00:00
|
|
|
|
* To add a child widget in the notebooks action area, specify
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* "action-start" or “action-end” as the “type” attribute of the
|
|
|
|
|
* <child> element.
|
2014-02-02 05:29:00 +00:00
|
|
|
|
*
|
|
|
|
|
* An example of a UI definition fragment with GtkNotebook:
|
2014-01-27 17:12:55 +00:00
|
|
|
|
* |[
|
2010-10-03 17:50:11 +00:00
|
|
|
|
* <object class="GtkNotebook">
|
|
|
|
|
* <child>
|
|
|
|
|
* <object class="GtkLabel" id="notebook-content">
|
|
|
|
|
* <property name="label">Content</property>
|
|
|
|
|
* </object>
|
|
|
|
|
* </child>
|
|
|
|
|
* <child type="tab">
|
|
|
|
|
* <object class="GtkLabel" id="notebook-tab">
|
|
|
|
|
* <property name="label">Tab</property>
|
|
|
|
|
* </object>
|
|
|
|
|
* </child>
|
|
|
|
|
* </object>
|
2014-01-27 17:12:55 +00:00
|
|
|
|
* ]|
|
2015-10-24 14:54:56 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* |[<!-- language="plain" -->
|
|
|
|
|
* notebook
|
|
|
|
|
* ├── header.top
|
2015-12-16 15:55:52 +00:00
|
|
|
|
* │ ├── [<action widget>]
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* │ ├── tabs
|
2015-11-08 20:01:09 +00:00
|
|
|
|
* │ │ ├── [arrow]
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* │ │ ├── tab
|
2015-12-16 15:55:52 +00:00
|
|
|
|
* │ │ │ ╰── <tab label>
|
|
|
|
|
* ┊ ┊ ┊
|
2015-11-08 20:01:09 +00:00
|
|
|
|
* │ │ ├── tab[.reorderable-page]
|
2015-12-16 15:55:52 +00:00
|
|
|
|
* │ │ │ ╰── <tab label>
|
2015-11-08 20:01:09 +00:00
|
|
|
|
* │ │ ╰── [arrow]
|
2015-12-16 15:55:52 +00:00
|
|
|
|
* │ ╰── [<action widget>]
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* │
|
2016-01-11 18:55:23 +00:00
|
|
|
|
* ╰── stack
|
|
|
|
|
* ├── <child>
|
|
|
|
|
* ┊
|
|
|
|
|
* ╰── <child>
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* ]|
|
|
|
|
|
*
|
2015-10-24 14:54:56 +00:00
|
|
|
|
* GtkNotebook has a main CSS node with name notebook, a subnode
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* with name header and below that a subnode with name tabs which
|
|
|
|
|
* contains one subnode per tab with name tab.
|
|
|
|
|
*
|
|
|
|
|
* If action widgets are present, their CSS nodes are placed next
|
2015-11-08 20:01:09 +00:00
|
|
|
|
* to the tabs node. If the notebook is scrollable, CSS nodes with
|
|
|
|
|
* name arrow are placed as first and last child of the tabs node.
|
2015-10-24 14:54:56 +00:00
|
|
|
|
*
|
2015-11-09 18:33:58 +00:00
|
|
|
|
* The main node gets the .frame style class when the notebook
|
2016-02-08 21:49:01 +00:00
|
|
|
|
* has a border (see gtk_notebook_set_show_border()).
|
2015-10-24 14:54:56 +00:00
|
|
|
|
*
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* The header node gets one of the style class .top, .bottom,
|
2015-10-24 14:54:56 +00:00
|
|
|
|
* .left or .right, depending on where the tabs are placed. For
|
2015-10-31 14:23:40 +00:00
|
|
|
|
* reorderable pages, the tab node gets the .reorderable-page class.
|
2016-01-13 05:24:40 +00:00
|
|
|
|
*
|
|
|
|
|
* A tab node gets the .dnd style class while it is moved with drag-and-drop.
|
2016-01-23 04:14:09 +00:00
|
|
|
|
*
|
|
|
|
|
* The nodes are always arranged from left-to-right, regarldess of text direction.
|
2010-10-03 17:50:11 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2006-01-12 21:31:55 +00:00
|
|
|
|
#define SCROLL_DELAY_FACTOR 5
|
2006-02-23 17:59:33 +00:00
|
|
|
|
#define SCROLL_THRESHOLD 12
|
|
|
|
|
#define DND_THRESHOLD_MULTIPLIER 4
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
#define TIMEOUT_INITIAL 500
|
|
|
|
|
#define TIMEOUT_REPEAT 50
|
|
|
|
|
#define TIMEOUT_EXPAND 500
|
|
|
|
|
|
2010-07-13 16:46:33 +00:00
|
|
|
|
typedef struct _GtkNotebookPage GtkNotebookPage;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
DRAG_OPERATION_NONE,
|
|
|
|
|
DRAG_OPERATION_REORDER,
|
|
|
|
|
DRAG_OPERATION_DETACH
|
|
|
|
|
} GtkNotebookDragOperation;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
ACTION_WIDGET_START,
|
|
|
|
|
ACTION_WIDGET_END,
|
|
|
|
|
N_ACTION_WIDGETS
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
|
struct _GtkNotebookPrivate
|
2010-07-13 15:47:05 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebookDragOperation operation;
|
|
|
|
|
GtkNotebookPage *cur_page;
|
|
|
|
|
GtkNotebookPage *detached_tab;
|
2017-11-18 01:19:53 +00:00
|
|
|
|
GdkContentFormats *source_targets;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkWidget *action_widget[N_ACTION_WIDGETS];
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *dnd_child;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkWidget *menu;
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *box;
|
|
|
|
|
GtkWidget *stack_widget;
|
|
|
|
|
GtkWidget *header_widget;
|
2017-05-11 06:09:14 +00:00
|
|
|
|
GtkWidget *tabs_widget;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
GtkWidget *arrow_widget[4];
|
2015-09-06 23:44:53 +00:00
|
|
|
|
|
2019-02-21 02:46:20 +00:00
|
|
|
|
GListModel *pages;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GList *children;
|
|
|
|
|
GList *first_tab; /* The first tab visible (for scrolling notebooks) */
|
|
|
|
|
GList *focus_tab;
|
|
|
|
|
|
|
|
|
|
gint drag_begin_x;
|
|
|
|
|
gint drag_begin_y;
|
|
|
|
|
gint drag_offset_x;
|
|
|
|
|
gint drag_offset_y;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
gint drag_surface_x;
|
|
|
|
|
gint drag_surface_y;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gint mouse_x;
|
|
|
|
|
gint mouse_y;
|
|
|
|
|
gint pressed_button;
|
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
GQuark group;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
guint dnd_timer;
|
|
|
|
|
guint switch_tab_timer;
|
2012-09-20 00:56:26 +00:00
|
|
|
|
GList *switch_tab;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
guint32 timer;
|
|
|
|
|
|
|
|
|
|
guint child_has_focus : 1;
|
|
|
|
|
guint click_child : 3;
|
2015-01-30 14:26:04 +00:00
|
|
|
|
guint remove_in_detach : 1;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
guint focus_out : 1; /* Flag used by ::move-focus-out implementation */
|
|
|
|
|
guint has_scrolled : 1;
|
|
|
|
|
guint need_timer : 1;
|
|
|
|
|
guint show_border : 1;
|
|
|
|
|
guint show_tabs : 1;
|
|
|
|
|
guint scrollable : 1;
|
|
|
|
|
guint tab_pos : 2;
|
2016-03-09 16:43:18 +00:00
|
|
|
|
guint rootwindow_drop : 1;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
};
|
|
|
|
|
|
1998-01-06 21:59:43 +00:00
|
|
|
|
enum {
|
|
|
|
|
SWITCH_PAGE,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
FOCUS_TAB,
|
|
|
|
|
SELECT_PAGE,
|
2001-11-16 22:20:00 +00:00
|
|
|
|
CHANGE_CURRENT_PAGE,
|
2002-02-08 01:10:25 +00:00
|
|
|
|
MOVE_FOCUS_OUT,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
REORDER_TAB,
|
2006-03-08 17:22:14 +00:00
|
|
|
|
PAGE_REORDERED,
|
|
|
|
|
PAGE_REMOVED,
|
|
|
|
|
PAGE_ADDED,
|
2007-06-04 14:39:56 +00:00
|
|
|
|
CREATE_WINDOW,
|
1998-01-06 21:59:43 +00:00
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
1998-02-19 05:13:46 +00:00
|
|
|
|
enum {
|
|
|
|
|
STEP_PREV,
|
|
|
|
|
STEP_NEXT
|
|
|
|
|
};
|
|
|
|
|
|
2003-05-22 22:34:31 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
ARROW_LEFT_BEFORE,
|
|
|
|
|
ARROW_RIGHT_BEFORE,
|
|
|
|
|
ARROW_LEFT_AFTER,
|
2015-11-08 20:01:09 +00:00
|
|
|
|
ARROW_RIGHT_AFTER,
|
|
|
|
|
ARROW_NONE
|
2003-05-22 22:34:31 +00:00
|
|
|
|
} GtkNotebookArrow;
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
POINTER_BEFORE,
|
|
|
|
|
POINTER_AFTER,
|
|
|
|
|
POINTER_BETWEEN
|
|
|
|
|
} GtkNotebookPointerPosition;
|
|
|
|
|
|
2003-05-22 22:34:31 +00:00
|
|
|
|
#define ARROW_IS_LEFT(arrow) ((arrow) == ARROW_LEFT_BEFORE || (arrow) == ARROW_LEFT_AFTER)
|
|
|
|
|
#define ARROW_IS_BEFORE(arrow) ((arrow) == ARROW_LEFT_BEFORE || (arrow) == ARROW_RIGHT_BEFORE)
|
|
|
|
|
|
1998-07-16 20:23:12 +00:00
|
|
|
|
enum {
|
2001-05-17 16:22:06 +00:00
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_TAB_POS,
|
|
|
|
|
PROP_SHOW_TABS,
|
|
|
|
|
PROP_SHOW_BORDER,
|
|
|
|
|
PROP_SCROLLABLE,
|
|
|
|
|
PROP_PAGE,
|
|
|
|
|
PROP_ENABLE_POPUP,
|
2015-09-07 22:53:06 +00:00
|
|
|
|
PROP_GROUP_NAME,
|
2019-02-21 02:46:20 +00:00
|
|
|
|
PROP_PAGES,
|
2015-09-07 22:53:06 +00:00
|
|
|
|
LAST_PROP
|
1998-07-16 20:23:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
static GParamSpec *properties[LAST_PROP];
|
|
|
|
|
|
1998-07-16 20:23:12 +00:00
|
|
|
|
enum {
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
|
CHILD_PROP_0,
|
|
|
|
|
CHILD_PROP_TAB_LABEL,
|
|
|
|
|
CHILD_PROP_MENU_LABEL,
|
|
|
|
|
CHILD_PROP_POSITION,
|
|
|
|
|
CHILD_PROP_TAB_EXPAND,
|
|
|
|
|
CHILD_PROP_TAB_FILL,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
CHILD_PROP_REORDERABLE,
|
2019-02-20 04:03:22 +00:00
|
|
|
|
CHILD_PROP_DETACHABLE,
|
|
|
|
|
CHILD_PROP_CHILD,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
CHILD_PROP_TAB,
|
|
|
|
|
CHILD_PROP_MENU,
|
1998-07-16 20:23:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
#define GTK_NOTEBOOK_PAGE_FROM_LIST(_glist_) ((GtkNotebookPage *)(_glist_)->data)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) \
|
|
|
|
|
(g_object_get_data (G_OBJECT ((_page_)->tab_label), "notebook") == _notebook_)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
struct _GtkNotebookPage
|
|
|
|
|
{
|
2019-02-20 04:03:22 +00:00
|
|
|
|
GObject instance;
|
2019-02-19 23:44:40 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkWidget *child;
|
|
|
|
|
GtkWidget *tab_label;
|
|
|
|
|
GtkWidget *menu_label;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *last_focus_child; /* Last descendant of the page that had focus */
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *tab_widget; /* widget used for the tab itself */
|
2015-09-06 23:44:53 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
char *tab_text;
|
|
|
|
|
char *menu_text;
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
guint default_menu : 1; /* If true, we create the menu label ourself */
|
|
|
|
|
guint default_tab : 1; /* If true, we create the tab label ourself */
|
2000-12-11 17:47:24 +00:00
|
|
|
|
guint expand : 1;
|
|
|
|
|
guint fill : 1;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
guint reorderable : 1;
|
|
|
|
|
guint detachable : 1;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
GtkRequisition requisition;
|
2001-03-21 18:58:28 +00:00
|
|
|
|
|
2006-02-20 23:11:55 +00:00
|
|
|
|
gulong mnemonic_activate_signal;
|
|
|
|
|
gulong notify_visible_handler;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-02-19 23:44:40 +00:00
|
|
|
|
struct _GtkNotebookPageClass
|
|
|
|
|
{
|
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GtkNotebookPage, gtk_notebook_page, G_TYPE_OBJECT)
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_page_init (GtkNotebookPage *page)
|
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
page->default_tab = TRUE;
|
|
|
|
|
page->default_menu = TRUE;
|
2019-02-21 04:39:01 +00:00
|
|
|
|
page->fill = TRUE;
|
2019-02-19 23:44:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_page_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (object);
|
|
|
|
|
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_clear_object (&page->child);
|
|
|
|
|
g_clear_object (&page->tab_label);
|
|
|
|
|
g_clear_object (&page->menu_label);
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_free (page->tab_text);
|
|
|
|
|
g_free (page->menu_text);
|
|
|
|
|
|
2019-02-19 23:44:40 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_notebook_page_parent_class)->finalize (object);
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-20 04:03:22 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_page_set_property (GObject *object,
|
|
|
|
|
guint property_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (object);
|
|
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
|
{
|
|
|
|
|
case CHILD_PROP_CHILD:
|
|
|
|
|
g_set_object (&page->child, g_value_get_object (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
case CHILD_PROP_TAB:
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_set_object (&page->tab_label, g_value_get_object (value));
|
2019-02-20 13:39:21 +00:00
|
|
|
|
page->default_tab = page->tab_label == NULL;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_MENU:
|
|
|
|
|
g_set_object (&page->menu_label, g_value_get_object (value));
|
|
|
|
|
page->default_menu = page->menu_label == NULL;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_TAB_LABEL:
|
|
|
|
|
g_free (page->tab_text);
|
|
|
|
|
page->tab_text = g_value_dup_string (value);
|
|
|
|
|
if (page->default_tab && GTK_IS_LABEL (page->tab_label))
|
|
|
|
|
gtk_label_set_label (GTK_LABEL (page->tab_label), page->tab_text);
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_MENU_LABEL:
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_free (page->menu_text);
|
|
|
|
|
page->menu_text = g_value_dup_string (value);
|
|
|
|
|
if (page->default_menu && GTK_IS_LABEL (page->menu_label))
|
|
|
|
|
gtk_label_set_label (GTK_LABEL (page->menu_label), page->menu_text);
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_POSITION:
|
2019-02-21 03:25:54 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = NULL;
|
|
|
|
|
if (page->tab_widget)
|
|
|
|
|
notebook = GTK_NOTEBOOK (g_object_get_data (G_OBJECT (page->tab_widget), "notebook"));
|
|
|
|
|
|
|
|
|
|
if (notebook)
|
|
|
|
|
gtk_notebook_reorder_child (notebook, page->child, g_value_get_int (value));
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_TAB_EXPAND:
|
2019-02-21 04:39:01 +00:00
|
|
|
|
if (page->expand != g_value_get_boolean (value))
|
|
|
|
|
{
|
|
|
|
|
page->expand = g_value_get_boolean (value);
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_TAB_FILL:
|
2019-02-21 04:39:01 +00:00
|
|
|
|
if (page->fill != g_value_get_boolean (value))
|
|
|
|
|
{
|
|
|
|
|
page->fill = g_value_get_boolean (value);
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_REORDERABLE:
|
2019-02-21 04:39:01 +00:00
|
|
|
|
if (page->reorderable != g_value_get_boolean (value))
|
|
|
|
|
{
|
|
|
|
|
page->reorderable = g_value_get_boolean (value);
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_DETACHABLE:
|
2019-02-21 04:39:01 +00:00
|
|
|
|
if (page->detachable != g_value_get_boolean (value))
|
|
|
|
|
{
|
|
|
|
|
page->detachable = g_value_get_boolean (value);
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_page_get_property (GObject *object,
|
|
|
|
|
guint property_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (object);
|
|
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
|
{
|
|
|
|
|
case CHILD_PROP_CHILD:
|
|
|
|
|
g_value_set_object (value, page->child);
|
|
|
|
|
break;
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
case CHILD_PROP_TAB:
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_value_set_object (value, page->tab_label);
|
|
|
|
|
break;
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
case CHILD_PROP_MENU:
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_value_set_object (value, page->menu_label);
|
|
|
|
|
break;
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
case CHILD_PROP_TAB_LABEL:
|
|
|
|
|
g_value_set_string (value, page->tab_text);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_MENU_LABEL:
|
|
|
|
|
g_value_set_string (value, page->menu_text);
|
|
|
|
|
break;
|
|
|
|
|
|
2019-02-20 04:03:22 +00:00
|
|
|
|
case CHILD_PROP_POSITION:
|
2019-02-21 03:25:54 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = NULL;
|
|
|
|
|
if (page->tab_widget)
|
|
|
|
|
notebook = GTK_NOTEBOOK (g_object_get_data (G_OBJECT (page->tab_widget), "notebook"));
|
|
|
|
|
|
|
|
|
|
if (notebook)
|
|
|
|
|
g_value_set_int (value, g_list_index (notebook->priv->children, page));
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_TAB_EXPAND:
|
|
|
|
|
g_value_set_boolean (value, page->expand);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_TAB_FILL:
|
|
|
|
|
g_value_set_boolean (value, page->fill);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_REORDERABLE:
|
|
|
|
|
g_value_set_boolean (value, page->reorderable);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CHILD_PROP_DETACHABLE:
|
|
|
|
|
g_value_set_boolean (value, page->detachable);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-19 23:44:40 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_page_class_init (GtkNotebookPageClass *class)
|
|
|
|
|
{
|
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
|
|
|
|
|
|
|
|
object_class->finalize = gtk_notebook_page_finalize;
|
2019-02-20 04:03:22 +00:00
|
|
|
|
object_class->get_property = gtk_notebook_page_get_property;
|
|
|
|
|
object_class->set_property = gtk_notebook_page_set_property;
|
|
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_CHILD,
|
|
|
|
|
g_param_spec_object ("child",
|
|
|
|
|
P_("Child"),
|
|
|
|
|
P_("The child for this page"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
g_object_class_install_property (object_class,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
CHILD_PROP_TAB,
|
|
|
|
|
g_param_spec_object ("tab",
|
2019-02-20 04:03:22 +00:00
|
|
|
|
P_("Tab"),
|
|
|
|
|
P_("The tab widget for this page"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
g_object_class_install_property (object_class,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
CHILD_PROP_MENU,
|
|
|
|
|
g_param_spec_object ("menu",
|
2019-02-20 04:03:22 +00:00
|
|
|
|
P_("Menu"),
|
|
|
|
|
P_("The label widget displayed in the child’s menu entry"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_TAB_LABEL,
|
|
|
|
|
g_param_spec_string ("tab-label",
|
|
|
|
|
P_("Tab label"),
|
|
|
|
|
P_("The text of the tab widget"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_MENU_LABEL,
|
|
|
|
|
g_param_spec_string ("menu-label",
|
|
|
|
|
P_("Menu label"),
|
|
|
|
|
P_("The text of the menu widget"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_POSITION,
|
|
|
|
|
g_param_spec_int ("position",
|
|
|
|
|
P_("Position"),
|
|
|
|
|
P_("The index of the child in the parent"),
|
|
|
|
|
-1, G_MAXINT, 0,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_TAB_EXPAND,
|
|
|
|
|
g_param_spec_boolean ("tab-expand",
|
|
|
|
|
P_("Tab expand"),
|
|
|
|
|
P_("Whether to expand the child’s tab"),
|
|
|
|
|
FALSE,
|
2019-02-21 04:39:01 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_TAB_FILL,
|
|
|
|
|
g_param_spec_boolean ("tab-fill",
|
|
|
|
|
P_("Tab fill"),
|
|
|
|
|
P_("Whether the child’s tab should fill the allocated area"),
|
|
|
|
|
TRUE,
|
2019-02-21 04:39:01 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_REORDERABLE,
|
|
|
|
|
g_param_spec_boolean ("reorderable",
|
|
|
|
|
P_("Tab reorderable"),
|
|
|
|
|
P_("Whether the tab is reorderable by user action"),
|
|
|
|
|
FALSE,
|
2019-02-21 04:39:01 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2019-02-20 04:03:22 +00:00
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
|
CHILD_PROP_DETACHABLE,
|
|
|
|
|
g_param_spec_boolean ("detachable",
|
|
|
|
|
P_("Tab detachable"),
|
|
|
|
|
P_("Whether the tab is detachable"),
|
|
|
|
|
FALSE,
|
2019-02-21 04:39:01 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2019-02-20 04:03:22 +00:00
|
|
|
|
|
2019-02-19 23:44:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-16 23:28:53 +00:00
|
|
|
|
static const char *src_notebook_targets [] = {
|
|
|
|
|
"GTK_NOTEBOOK_TAB",
|
|
|
|
|
"application/x-rootwindow-drop"
|
2006-03-22 20:17:23 +00:00
|
|
|
|
};
|
|
|
|
|
|
2017-11-16 23:28:53 +00:00
|
|
|
|
static const char *dst_notebook_targets [] = {
|
|
|
|
|
"GTK_NOTEBOOK_TAB"
|
2016-03-09 16:43:18 +00:00
|
|
|
|
};
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Methods ***/
|
2002-02-08 01:10:25 +00:00
|
|
|
|
static gboolean gtk_notebook_select_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean move_focus);
|
2002-02-08 01:10:25 +00:00
|
|
|
|
static gboolean gtk_notebook_focus_tab (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookTab type);
|
2007-01-02 06:22:37 +00:00
|
|
|
|
static gboolean gtk_notebook_change_current_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint offset);
|
2002-02-08 01:10:25 +00:00
|
|
|
|
static void gtk_notebook_move_focus_out (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction_type);
|
2007-01-02 06:22:37 +00:00
|
|
|
|
static gboolean gtk_notebook_reorder_tab (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction_type,
|
|
|
|
|
gboolean move_to_last);
|
2007-11-26 18:21:13 +00:00
|
|
|
|
static void gtk_notebook_remove_tab_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page);
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
/*** GObject Methods ***/
|
2011-01-04 07:21:38 +00:00
|
|
|
|
static void gtk_notebook_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_notebook_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2016-06-05 23:35:12 +00:00
|
|
|
|
static void gtk_notebook_finalize (GObject *object);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
static void gtk_notebook_dispose (GObject *object);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkWidget Methods ***/
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void gtk_notebook_destroy (GtkWidget *widget);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void gtk_notebook_unmap (GtkWidget *widget);
|
2016-10-22 14:06:14 +00:00
|
|
|
|
static void gtk_notebook_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2017-07-11 07:58:21 +00:00
|
|
|
|
static void gtk_notebook_size_allocate (GtkWidget *widget,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline);
|
2006-02-22 16:35:09 +00:00
|
|
|
|
static gboolean gtk_notebook_popup_menu (GtkWidget *widget);
|
2018-01-02 21:29:38 +00:00
|
|
|
|
static void gtk_notebook_motion (GtkEventController *controller,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
2003-03-29 00:11:32 +00:00
|
|
|
|
static void gtk_notebook_grab_notify (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean was_grabbed);
|
2010-12-13 12:39:53 +00:00
|
|
|
|
static void gtk_notebook_state_flags_changed (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkStateFlags previous_state);
|
2013-09-26 23:12:58 +00:00
|
|
|
|
static gboolean gtk_notebook_focus (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/*** Drag and drop Methods ***/
|
|
|
|
|
static void gtk_notebook_drag_begin (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
static void gtk_notebook_drag_end (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag);
|
2006-12-28 16:38:49 +00:00
|
|
|
|
static gboolean gtk_notebook_drag_failed (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDragResult result);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static gboolean gtk_notebook_drag_motion (GtkWidget *widget,
|
2018-05-17 02:51:18 +00:00
|
|
|
|
GdkDrop *drop,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint x,
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gint y);
|
2006-03-22 20:17:23 +00:00
|
|
|
|
static void gtk_notebook_drag_leave (GtkWidget *widget,
|
2018-05-15 22:59:01 +00:00
|
|
|
|
GdkDrop *drop);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static gboolean gtk_notebook_drag_drop (GtkWidget *widget,
|
2018-05-17 02:51:18 +00:00
|
|
|
|
GdkDrop *drop,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint x,
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gint y);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static void gtk_notebook_drag_data_get (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag,
|
2018-06-16 02:49:47 +00:00
|
|
|
|
GtkSelectionData *data);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static void gtk_notebook_drag_data_received (GtkWidget *widget,
|
2018-05-16 02:50:24 +00:00
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
GtkSelectionData *data);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkContainer Methods ***/
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void gtk_notebook_add (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *widget);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void gtk_notebook_remove (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *widget);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_set_focus_child (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child);
|
2002-10-05 23:15:39 +00:00
|
|
|
|
static GType gtk_notebook_child_type (GtkContainer *container);
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
static void gtk_notebook_forall (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkCallback callback,
|
|
|
|
|
gpointer callback_data);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/*** GtkNotebook Methods ***/
|
|
|
|
|
static gint gtk_notebook_real_insert_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
GtkWidget *menu_label,
|
|
|
|
|
gint position);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2007-06-04 14:39:56 +00:00
|
|
|
|
static GtkNotebook *gtk_notebook_create_window (GtkNotebook *notebook,
|
|
|
|
|
GtkWidget *page,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y);
|
|
|
|
|
|
2017-05-11 06:09:14 +00:00
|
|
|
|
static void gtk_notebook_measure_tabs (GtkGizmo *gizmo,
|
2015-12-19 21:25:34 +00:00
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gint *natural_baseline);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
static void gtk_notebook_allocate_tabs (GtkGizmo *gizmo,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline);
|
2019-01-18 07:01:40 +00:00
|
|
|
|
static void gtk_notebook_snapshot_tabs (GtkGizmo *gizmo,
|
2017-05-11 06:09:14 +00:00
|
|
|
|
GtkSnapshot *snapshot);
|
2015-12-17 23:47:03 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Private Functions ***/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_real_remove (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *list);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_update_labels (GtkNotebook *notebook);
|
|
|
|
|
static gint gtk_notebook_timer (GtkNotebook *notebook);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
static void gtk_notebook_set_scroll_timer (GtkNotebook *notebook);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static gint gtk_notebook_page_compare (gconstpointer a,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gconstpointer b);
|
2001-07-31 21:23:19 +00:00
|
|
|
|
static GList* gtk_notebook_find_child (GtkNotebook *notebook,
|
2015-09-09 00:55:32 +00:00
|
|
|
|
GtkWidget *child);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static GList * gtk_notebook_search_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *list,
|
|
|
|
|
gint direction,
|
|
|
|
|
gboolean find_visible);
|
2007-12-31 16:26:18 +00:00
|
|
|
|
static void gtk_notebook_child_reordered (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page);
|
2019-02-20 16:43:15 +00:00
|
|
|
|
static gint gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
|
|
|
|
|
GtkNotebookPage *page,
|
|
|
|
|
int position);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Size Allocate Functions ***/
|
2015-12-29 18:18:02 +00:00
|
|
|
|
static void gtk_notebook_pages_allocate (GtkNotebook *notebook,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_calc_tabs (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *start,
|
|
|
|
|
GList **end,
|
|
|
|
|
gint *tab_space,
|
|
|
|
|
guint direction);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Page Switch Methods ***/
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
static void gtk_notebook_real_switch_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
guint page_num);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Page Switch Functions ***/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_switch_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
static gint gtk_notebook_page_select (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean move_focus);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
|
|
|
|
|
GList *new_child);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void gtk_notebook_menu_switch_page (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** GtkNotebook Menu Functions ***/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_menu_item_create (GtkNotebook *notebook,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
GtkNotebookPage *page);
|
2018-10-12 22:12:53 +00:00
|
|
|
|
static void gtk_notebook_menu_item_recreate (GtkNotebook *notebook,
|
|
|
|
|
GList *list);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void gtk_notebook_menu_label_unparent (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gpointer data);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void gtk_notebook_menu_detacher (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkMenu *menu);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2015-12-23 03:09:30 +00:00
|
|
|
|
static void gtk_notebook_update_tab_pos (GtkNotebook *notebook);
|
|
|
|
|
|
add -DGTK_DISABLE_DEPRECATED. #undef it at the top of gtktypebuiltins.c.
Tue Nov 19 17:05:51 2002 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: add -DGTK_DISABLE_DEPRECATED. #undef it at the
top of gtktypebuiltins.c.
* gtk/gtkclist.c
* gtk/gtkcombo.c
* gtk/gtkctree.c
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkoldeditable.c
* gtk/gtkpixmap.c
* gtk/gtkpreview.c
* gtk/gtksignal.c
* gtk/gtktext.c
* gtk/gtktipsquery.c
* gtk/gtktree.c
* gtk/gtktreeitem.c
* gtk/gtktypeutils.c: #undef GTK_DISABLE_DEPRECATED, deprecated widgets
and compat code.
* gtk/gtkcolorsel.c: move gtk_color_selection_set_color implementation
to set_color_internal, and use that. The deprecated function now
merely wraps it.
* gtk/gtkfontsel.c: same as above, except with
gtk_font_selection_get_font.
* gtk/gtknotebook.c: same as above, except with
gtk_notebook_set_homogeneous, and gtk_notebook_set_tab_{border,
hborder,vborder}.
* gtk/gtkprogressbar.c: same as above, except with
gtk_progress_bar_set_{bar_stype,discrete_blocks,activity_step,
activity_blocks}.
* gtk/gtkstyle.c: same as above, except with gtk_style_get_font.
* gtk/gtkwidget.c: same as above, except with gtk_widget_set_usize.
* gtk/gtkitemfactory.h: declare compatibility functions for deprecated
GtkMenuFactory stuff if GTK_COMPILATION, since they are used
internally by the compat code.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
use of deprecated gtk_check_menu_item_set_show_toggle (it is a noop
now).
* gtk/gtkmain.c: replaced deprecated GTK_TYPE_* with G_TYPE_*.
* gtk/gtkobject.c: replaced various deprecated functions. In set and
get_property, use g_object_{set,get}_data with "user_data" instead
of gtk_object_{set,get}_user_data.
* gtk/gtkprogress.h: API declared if GTK_COMPILATION
* gtk/gtkprogress.c: port get_type to GObject API.
* gtk/gtktypeutils.h: declare GtkArg stuff and gtk_type_init,
if GTK_COMPILATION.
* gtk/gtkwidget.c: define gtk_widget_queue_clear in terms of
gtk_widget_queue_draw instead of the other way around.
* tests/Makefile.am: define -DGTK_DISABLE_DEPRECATED
* tests/testgtk.c
* tests/testselection.c
* tests/testsocket.c: #undef GTK_DISABLE_DEPRECATED, makes use of
deprecated stuff.
2002-11-20 01:07:33 +00:00
|
|
|
|
/*** GtkNotebook Private Setters ***/
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static gboolean gtk_notebook_mnemonic_activate_switch_page (GtkWidget *child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean overload,
|
|
|
|
|
gpointer data);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
static gboolean focus_tabs_in (GtkNotebook *notebook);
|
|
|
|
|
static gboolean focus_child_in (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2005-03-22 17:36:41 +00:00
|
|
|
|
static void stop_scrolling (GtkNotebook *notebook);
|
2006-12-28 16:38:49 +00:00
|
|
|
|
static void do_detach_tab (GtkNotebook *from,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebook *to,
|
2017-12-05 03:06:20 +00:00
|
|
|
|
GtkWidget *child);
|
2005-03-22 17:36:41 +00:00
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
/* GtkBuildable */
|
|
|
|
|
static void gtk_notebook_buildable_init (GtkBuildableIface *iface);
|
2007-06-19 12:23:36 +00:00
|
|
|
|
static void gtk_notebook_buildable_add_child (GtkBuildable *buildable,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *type);
|
2005-03-22 17:36:41 +00:00
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
static void gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
static void gtk_notebook_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
|
static guint notebook_signals[LAST_SIGNAL] = { 0 };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkNotebook, gtk_notebook, GTK_TYPE_CONTAINER,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkNotebook)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
|
|
|
|
gtk_notebook_buildable_init))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
static void
|
|
|
|
|
add_tab_bindings (GtkBindingSet *binding_set,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GdkModifierType modifiers,
|
|
|
|
|
GtkDirectionType direction)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers,
|
2002-02-08 01:10:25 +00:00
|
|
|
|
"move_focus_out", 1,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction);
|
2010-09-08 17:35:51 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers,
|
2002-02-08 01:10:25 +00:00
|
|
|
|
"move_focus_out", 1,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
add_arrow_bindings (GtkBindingSet *binding_set,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
guint keysym,
|
|
|
|
|
GtkDirectionType direction)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
|
guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set, keysym, GDK_CONTROL_MASK,
|
|
|
|
|
"move_focus_out", 1,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, keypad_keysym, GDK_CONTROL_MASK,
|
|
|
|
|
"move_focus_out", 1,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction);
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static void
|
|
|
|
|
add_reorder_bindings (GtkBindingSet *binding_set,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
guint keysym,
|
|
|
|
|
GtkDirectionType direction,
|
|
|
|
|
gboolean move_to_last)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
|
guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, keysym, GDK_MOD1_MASK,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"reorder_tab", 2,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction,
|
|
|
|
|
G_TYPE_BOOLEAN, move_to_last);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set, keypad_keysym, GDK_MOD1_MASK,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"reorder_tab", 2,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE, direction,
|
|
|
|
|
G_TYPE_BOOLEAN, move_to_last);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-06-04 14:39:56 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_object_handled_accumulator (GSignalInvocationHint *ihint,
|
|
|
|
|
GValue *return_accu,
|
|
|
|
|
const GValue *handler_return,
|
|
|
|
|
gpointer dummy)
|
|
|
|
|
{
|
|
|
|
|
gboolean continue_emission;
|
|
|
|
|
GObject *object;
|
|
|
|
|
|
|
|
|
|
object = g_value_get_object (handler_return);
|
|
|
|
|
g_value_set_object (return_accu, object);
|
|
|
|
|
continue_emission = !object;
|
|
|
|
|
|
|
|
|
|
return continue_emission;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-11 19:23:03 +00:00
|
|
|
|
static void
|
2010-10-18 16:25:03 +00:00
|
|
|
|
gtk_notebook_compute_expand (GtkWidget *widget,
|
|
|
|
|
gboolean *hexpand_p,
|
|
|
|
|
gboolean *vexpand_p)
|
2010-10-11 19:23:03 +00:00
|
|
|
|
{
|
2010-10-18 16:25:03 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-10-11 19:23:03 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
gboolean hexpand;
|
|
|
|
|
gboolean vexpand;
|
|
|
|
|
GList *list;
|
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
|
|
|
|
hexpand = FALSE;
|
|
|
|
|
vexpand = FALSE;
|
|
|
|
|
|
|
|
|
|
for (list = priv->children; list; list = list->next)
|
|
|
|
|
{
|
|
|
|
|
page = list->data;
|
|
|
|
|
|
|
|
|
|
hexpand = hexpand ||
|
|
|
|
|
gtk_widget_compute_expand (page->child, GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
|
|
|
|
|
vexpand = vexpand ||
|
|
|
|
|
gtk_widget_compute_expand (page->child, GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
|
|
|
|
|
if (hexpand & vexpand)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*hexpand_p = hexpand;
|
|
|
|
|
*vexpand_p = vexpand;
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_class_init (GtkNotebookClass *class)
|
|
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
|
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
|
|
|
|
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GtkBindingSet *binding_set;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2001-05-17 16:22:06 +00:00
|
|
|
|
gobject_class->set_property = gtk_notebook_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_notebook_get_property;
|
2016-06-05 23:35:12 +00:00
|
|
|
|
gobject_class->finalize = gtk_notebook_finalize;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gobject_class->dispose = gtk_notebook_dispose;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
widget_class->destroy = gtk_notebook_destroy;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
widget_class->unmap = gtk_notebook_unmap;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
widget_class->measure = gtk_notebook_measure;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
widget_class->size_allocate = gtk_notebook_size_allocate;
|
2006-02-22 16:35:09 +00:00
|
|
|
|
widget_class->popup_menu = gtk_notebook_popup_menu;
|
2003-03-29 00:11:32 +00:00
|
|
|
|
widget_class->grab_notify = gtk_notebook_grab_notify;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
widget_class->state_flags_changed = gtk_notebook_state_flags_changed;
|
2001-06-08 18:09:34 +00:00
|
|
|
|
widget_class->focus = gtk_notebook_focus;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
widget_class->drag_begin = gtk_notebook_drag_begin;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
widget_class->drag_end = gtk_notebook_drag_end;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
widget_class->drag_motion = gtk_notebook_drag_motion;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
widget_class->drag_leave = gtk_notebook_drag_leave;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
widget_class->drag_drop = gtk_notebook_drag_drop;
|
|
|
|
|
widget_class->drag_data_get = gtk_notebook_drag_data_get;
|
|
|
|
|
widget_class->drag_data_received = gtk_notebook_drag_data_received;
|
2010-12-22 23:46:29 +00:00
|
|
|
|
widget_class->drag_failed = gtk_notebook_drag_failed;
|
2010-10-11 19:23:03 +00:00
|
|
|
|
widget_class->compute_expand = gtk_notebook_compute_expand;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
container_class->add = gtk_notebook_add;
|
|
|
|
|
container_class->remove = gtk_notebook_remove;
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
container_class->forall = gtk_notebook_forall;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
container_class->set_focus_child = gtk_notebook_set_focus_child;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
container_class->child_type = gtk_notebook_child_type;
|
1998-01-06 21:59:43 +00:00
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
class->switch_page = gtk_notebook_real_switch_page;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
class->insert_page = gtk_notebook_real_insert_page;
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
class->focus_tab = gtk_notebook_focus_tab;
|
|
|
|
|
class->select_page = gtk_notebook_select_page;
|
2001-11-16 22:20:00 +00:00
|
|
|
|
class->change_current_page = gtk_notebook_change_current_page;
|
2002-02-08 01:10:25 +00:00
|
|
|
|
class->move_focus_out = gtk_notebook_move_focus_out;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
class->reorder_tab = gtk_notebook_reorder_tab;
|
2007-06-04 14:39:56 +00:00
|
|
|
|
class->create_window = gtk_notebook_create_window;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
properties[PROP_PAGE] =
|
|
|
|
|
g_param_spec_int ("page",
|
|
|
|
|
P_("Page"),
|
|
|
|
|
P_("The index of the current page"),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_TAB_POS] =
|
|
|
|
|
g_param_spec_enum ("tab-pos",
|
|
|
|
|
P_("Tab Position"),
|
|
|
|
|
P_("Which side of the notebook holds the tabs"),
|
|
|
|
|
GTK_TYPE_POSITION_TYPE,
|
|
|
|
|
GTK_POS_TOP,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_SHOW_TABS] =
|
|
|
|
|
g_param_spec_boolean ("show-tabs",
|
|
|
|
|
P_("Show Tabs"),
|
|
|
|
|
P_("Whether tabs should be shown"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_SHOW_BORDER] =
|
|
|
|
|
g_param_spec_boolean ("show-border",
|
|
|
|
|
P_("Show Border"),
|
|
|
|
|
P_("Whether the border should be shown"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_SCROLLABLE] =
|
|
|
|
|
g_param_spec_boolean ("scrollable",
|
|
|
|
|
P_("Scrollable"),
|
|
|
|
|
P_("If TRUE, scroll arrows are added if there are too many tabs to fit"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
properties[PROP_ENABLE_POPUP] =
|
|
|
|
|
g_param_spec_boolean ("enable-popup",
|
|
|
|
|
P_("Enable Popup"),
|
|
|
|
|
P_("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2007-06-07 06:09:43 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* GtkNotebook:group-name:
|
2007-06-07 06:09:43 +00:00
|
|
|
|
*
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* Group name for tab drag and drop.
|
|
|
|
|
*/
|
2015-09-07 22:53:06 +00:00
|
|
|
|
properties[PROP_GROUP_NAME] =
|
|
|
|
|
g_param_spec_string ("group-name",
|
|
|
|
|
P_("Group Name"),
|
|
|
|
|
P_("Group name for tab drag and drop"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2019-02-21 02:46:20 +00:00
|
|
|
|
properties[PROP_PAGES] =
|
|
|
|
|
g_param_spec_object ("pages",
|
|
|
|
|
P_("Pages"),
|
|
|
|
|
P_("The pages of the notebook."),
|
|
|
|
|
G_TYPE_LIST_MODEL,
|
|
|
|
|
GTK_PARAM_READABLE);
|
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_class_install_properties (gobject_class, LAST_PROP, properties);
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
|
|
2010-10-03 17:50:11 +00:00
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
notebook_signals[SWITCH_PAGE] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("switch-page"),
|
2011-01-04 07:21:38 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, switch_page),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__OBJECT_UINT,
|
|
|
|
|
G_TYPE_NONE, 2,
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
G_TYPE_UINT);
|
|
|
|
|
notebook_signals[FOCUS_TAB] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("focus-tab"),
|
2002-10-05 23:15:39 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, focus_tab),
|
|
|
|
|
NULL, NULL,
|
2002-01-17 00:34:58 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM,
|
2002-02-08 00:02:52 +00:00
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
GTK_TYPE_NOTEBOOK_TAB);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[SELECT_PAGE] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("select-page"),
|
2002-10-05 23:15:39 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, select_page),
|
|
|
|
|
NULL, NULL,
|
2002-01-17 00:34:58 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_BOOLEAN);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[CHANGE_CURRENT_PAGE] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("change-current-page"),
|
2002-10-05 23:15:39 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-11-16 22:20:00 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, change_current_page),
|
|
|
|
|
NULL, NULL,
|
2007-01-02 06:22:37 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__INT,
|
|
|
|
|
G_TYPE_BOOLEAN, 1,
|
2001-11-16 22:20:00 +00:00
|
|
|
|
G_TYPE_INT);
|
2002-02-08 01:10:25 +00:00
|
|
|
|
notebook_signals[MOVE_FOCUS_OUT] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("move-focus-out"),
|
2002-10-05 23:15:39 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2002-02-08 01:10:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, move_focus_out),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2002-02-08 01:10:25 +00:00
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
|
GTK_TYPE_DIRECTION_TYPE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
notebook_signals[REORDER_TAB] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("reorder-tab"),
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, reorder_tab),
|
|
|
|
|
NULL, NULL,
|
2007-01-02 06:22:37 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM_BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN, 2,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GTK_TYPE_DIRECTION_TYPE,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
G_TYPE_BOOLEAN);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/**
|
2006-03-08 17:22:14 +00:00
|
|
|
|
* GtkNotebook::page-reordered:
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* @notebook: the #GtkNotebook
|
|
|
|
|
* @child: the child #GtkWidget affected
|
|
|
|
|
* @page_num: the new page number for @child
|
|
|
|
|
*
|
2006-03-08 17:22:14 +00:00
|
|
|
|
* the ::page-reordered signal is emitted in the notebook
|
|
|
|
|
* right after a page has been reordered.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-03-08 17:22:14 +00:00
|
|
|
|
notebook_signals[PAGE_REORDERED] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("page-reordered"),
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2006-03-08 17:22:14 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, page_reordered),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__OBJECT_UINT,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_NONE, 2,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
G_TYPE_UINT);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/**
|
2006-03-08 17:22:14 +00:00
|
|
|
|
* GtkNotebook::page-removed:
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* @notebook: the #GtkNotebook
|
|
|
|
|
* @child: the child #GtkWidget affected
|
|
|
|
|
* @page_num: the @child page number
|
|
|
|
|
*
|
2006-03-08 17:22:14 +00:00
|
|
|
|
* the ::page-removed signal is emitted in the notebook
|
2006-03-22 21:11:40 +00:00
|
|
|
|
* right after a page is removed from the notebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-03-08 17:22:14 +00:00
|
|
|
|
notebook_signals[PAGE_REMOVED] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("page-removed"),
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2006-03-08 17:22:14 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, page_removed),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__OBJECT_UINT,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_NONE, 2,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
G_TYPE_UINT);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/**
|
2006-03-22 21:11:40 +00:00
|
|
|
|
* GtkNotebook::page-added:
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* @notebook: the #GtkNotebook
|
|
|
|
|
* @child: the child #GtkWidget affected
|
|
|
|
|
* @page_num: the new page number for @child
|
|
|
|
|
*
|
2006-03-08 17:22:14 +00:00
|
|
|
|
* the ::page-added signal is emitted in the notebook
|
|
|
|
|
* right after a page is added to the notebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-03-08 17:22:14 +00:00
|
|
|
|
notebook_signals[PAGE_ADDED] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("page-added"),
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2006-03-08 17:22:14 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, page_added),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__OBJECT_UINT,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
G_TYPE_NONE, 2,
|
2010-10-03 16:17:17 +00:00
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
G_TYPE_UINT);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2007-06-04 14:39:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkNotebook::create-window:
|
|
|
|
|
* @notebook: the #GtkNotebook emitting the signal
|
|
|
|
|
* @page: the tab of @notebook that is being detached
|
|
|
|
|
* @x: the X coordinate where the drop happens
|
|
|
|
|
* @y: the Y coordinate where the drop happens
|
|
|
|
|
*
|
|
|
|
|
* The ::create-window signal is emitted when a detachable
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* tab is dropped on the root window.
|
2007-06-04 14:39:56 +00:00
|
|
|
|
*
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* A handler for this signal can create a window containing
|
|
|
|
|
* a notebook where the tab will be attached. It is also
|
|
|
|
|
* responsible for moving/resizing the window and adding the
|
|
|
|
|
* necessary properties to the notebook (e.g. the
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* #GtkNotebook:group-name ).
|
2007-06-04 14:39:56 +00:00
|
|
|
|
*
|
2011-01-18 09:01:17 +00:00
|
|
|
|
* Returns: (transfer none): a #GtkNotebook that @page should be
|
|
|
|
|
* added to, or %NULL.
|
2007-06-04 14:39:56 +00:00
|
|
|
|
*/
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[CREATE_WINDOW] =
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_new (I_("create-window"),
|
2007-06-04 14:39:56 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkNotebookClass, create_window),
|
|
|
|
|
gtk_object_handled_accumulator, NULL,
|
|
|
|
|
_gtk_marshal_OBJECT__OBJECT_INT_INT,
|
|
|
|
|
GTK_TYPE_NOTEBOOK, 3,
|
|
|
|
|
GTK_TYPE_WIDGET, G_TYPE_INT, G_TYPE_INT);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2002-10-05 23:15:39 +00:00
|
|
|
|
binding_set = gtk_binding_set_by_class (class);
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_space, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"select-page", 1,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
G_TYPE_BOOLEAN, FALSE);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_KP_Space, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"select-page", 1,
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
G_TYPE_BOOLEAN, FALSE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_Home, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"focus-tab", 1,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_KP_Home, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"focus-tab", 1,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_End, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"focus-tab", 1,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_KP_End, 0,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"focus-tab", 1,
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST);
|
2001-11-16 22:20:00 +00:00
|
|
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_Page_Up, GDK_CONTROL_MASK,
|
2008-08-11 11:52:06 +00:00
|
|
|
|
"change-current-page", 1,
|
2001-11-16 22:20:00 +00:00
|
|
|
|
G_TYPE_INT, -1);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_Page_Down, GDK_CONTROL_MASK,
|
2008-08-11 11:52:06 +00:00
|
|
|
|
"change-current-page", 1,
|
2001-11-16 22:20:00 +00:00
|
|
|
|
G_TYPE_INT, 1);
|
2002-02-08 01:10:25 +00:00
|
|
|
|
|
2003-02-05 23:48:11 +00:00
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK,
|
2008-08-11 11:52:06 +00:00
|
|
|
|
"change-current-page", 1,
|
2003-02-05 23:48:11 +00:00
|
|
|
|
G_TYPE_INT, -1);
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
2010-09-08 17:35:51 +00:00
|
|
|
|
GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK,
|
2008-08-11 11:52:06 +00:00
|
|
|
|
"change-current-page", 1,
|
2003-02-05 23:48:11 +00:00
|
|
|
|
G_TYPE_INT, 1);
|
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
|
add_arrow_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP);
|
|
|
|
|
add_arrow_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN);
|
|
|
|
|
add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT);
|
|
|
|
|
add_arrow_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT);
|
|
|
|
|
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP, FALSE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN, FALSE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT, FALSE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT, FALSE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Home, GTK_DIR_LEFT, TRUE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_Home, GTK_DIR_UP, TRUE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_End, GTK_DIR_RIGHT, TRUE);
|
|
|
|
|
add_reorder_bindings (binding_set, GDK_KEY_End, GTK_DIR_DOWN, TRUE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
|
|
|
|
|
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2011-07-01 02:11:13 +00:00
|
|
|
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_NOTEBOOK_ACCESSIBLE);
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("notebook"));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-07-16 20:23:12 +00:00
|
|
|
|
static void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_init (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2017-11-18 01:19:53 +00:00
|
|
|
|
GdkContentFormats *targets;
|
2018-03-10 17:45:23 +00:00
|
|
|
|
GtkEventController *controller;
|
2018-03-09 05:14:59 +00:00
|
|
|
|
GtkGesture *gesture;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-03-02 03:40:38 +00:00
|
|
|
|
gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
|
2018-03-20 14:21:12 +00:00
|
|
|
|
gtk_widget_set_has_surface (GTK_WIDGET (notebook), FALSE);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
notebook->priv = gtk_notebook_get_instance_private (notebook);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
priv->cur_page = NULL;
|
|
|
|
|
priv->children = NULL;
|
|
|
|
|
priv->first_tab = NULL;
|
|
|
|
|
priv->focus_tab = NULL;
|
|
|
|
|
priv->menu = NULL;
|
|
|
|
|
|
|
|
|
|
priv->show_tabs = TRUE;
|
|
|
|
|
priv->show_border = TRUE;
|
|
|
|
|
priv->tab_pos = GTK_POS_TOP;
|
|
|
|
|
priv->scrollable = FALSE;
|
2016-02-11 11:47:28 +00:00
|
|
|
|
priv->click_child = ARROW_NONE;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->need_timer = 0;
|
|
|
|
|
priv->child_has_focus = FALSE;
|
|
|
|
|
priv->focus_out = FALSE;
|
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
priv->group = 0;
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->pressed_button = 0;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
priv->dnd_timer = 0;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
priv->switch_tab_timer = 0;
|
2017-11-18 01:19:53 +00:00
|
|
|
|
priv->source_targets = gdk_content_formats_new (src_notebook_targets,
|
2016-03-09 16:43:18 +00:00
|
|
|
|
G_N_ELEMENTS (src_notebook_targets));
|
2006-05-09 02:36:08 +00:00
|
|
|
|
priv->operation = DRAG_OPERATION_NONE;
|
|
|
|
|
priv->detached_tab = NULL;
|
|
|
|
|
priv->has_scrolled = FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-11-18 01:19:53 +00:00
|
|
|
|
targets = gdk_content_formats_new (dst_notebook_targets, G_N_ELEMENTS (dst_notebook_targets));
|
2007-05-18 11:07:04 +00:00
|
|
|
|
gtk_drag_dest_set (GTK_WIDGET (notebook), 0,
|
2017-11-14 21:32:23 +00:00
|
|
|
|
targets,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GDK_ACTION_MOVE);
|
2017-11-18 01:19:53 +00:00
|
|
|
|
gdk_content_formats_unref (targets);
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
|
|
|
|
gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
|
2010-12-13 12:39:53 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
priv->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
|
|
|
|
gtk_widget_set_parent (priv->box, GTK_WIDGET (notebook));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
priv->header_widget = g_object_new (GTK_TYPE_BOX,
|
|
|
|
|
"css-name", "header",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (priv->header_widget),
|
|
|
|
|
GTK_STYLE_CLASS_TOP);
|
|
|
|
|
gtk_widget_hide (priv->header_widget);
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->box), priv->header_widget);
|
2015-10-31 14:23:40 +00:00
|
|
|
|
|
2017-05-11 06:09:14 +00:00
|
|
|
|
priv->tabs_widget = gtk_gizmo_new ("tabs",
|
|
|
|
|
gtk_notebook_measure_tabs,
|
|
|
|
|
gtk_notebook_allocate_tabs,
|
|
|
|
|
gtk_notebook_snapshot_tabs);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->tabs_widget, TRUE);
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->header_widget), priv->tabs_widget);
|
|
|
|
|
|
|
|
|
|
priv->stack_widget = gtk_stack_new ();
|
|
|
|
|
gtk_widget_set_hexpand (priv->stack_widget, TRUE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->stack_widget, TRUE);
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->box), priv->stack_widget);
|
2016-11-03 20:02:53 +00:00
|
|
|
|
|
2018-03-09 05:14:59 +00:00
|
|
|
|
gesture = gtk_gesture_multi_press_new ();
|
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
|
|
|
|
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE);
|
|
|
|
|
g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_notebook_gesture_pressed), notebook);
|
|
|
|
|
g_signal_connect (gesture, "released", G_CALLBACK (gtk_notebook_gesture_released), notebook);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (notebook), GTK_EVENT_CONTROLLER (gesture));
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
2018-03-10 17:45:23 +00:00
|
|
|
|
controller = gtk_event_controller_motion_new ();
|
|
|
|
|
g_signal_connect (controller, "motion", G_CALLBACK (gtk_notebook_motion), notebook);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (notebook), controller);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (notebook)),
|
|
|
|
|
GTK_STYLE_CLASS_FRAME);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-08 02:13:57 +00:00
|
|
|
|
static GtkBuildableIface *parent_buildable_iface;
|
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_buildable_init (GtkBuildableIface *iface)
|
|
|
|
|
{
|
2018-03-08 02:13:57 +00:00
|
|
|
|
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
|
|
|
|
|
2007-06-19 12:23:36 +00:00
|
|
|
|
iface->add_child = gtk_notebook_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2007-06-19 12:23:36 +00:00
|
|
|
|
gtk_notebook_buildable_add_child (GtkBuildable *buildable,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *type)
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (buildable);
|
|
|
|
|
|
2019-02-20 16:43:15 +00:00
|
|
|
|
if (GTK_IS_NOTEBOOK_PAGE (child))
|
|
|
|
|
{
|
|
|
|
|
gtk_notebook_insert_notebook_page (notebook, GTK_NOTEBOOK_PAGE (child), -1);
|
|
|
|
|
}
|
|
|
|
|
else if (GTK_IS_WIDGET (child))
|
2009-11-09 02:34:29 +00:00
|
|
|
|
{
|
2018-03-08 02:13:57 +00:00
|
|
|
|
if (type && strcmp (type, "tab") == 0)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget * page;
|
|
|
|
|
|
|
|
|
|
page = gtk_notebook_get_nth_page (notebook, -1);
|
|
|
|
|
/* To set the tab label widget, we must have already a child
|
|
|
|
|
* inside the tab container. */
|
|
|
|
|
g_assert (page != NULL);
|
|
|
|
|
/* warn when Glade tries to overwrite label */
|
|
|
|
|
if (gtk_notebook_get_tab_label (notebook, page))
|
|
|
|
|
g_warning ("Overriding tab label for notebook");
|
|
|
|
|
gtk_notebook_set_tab_label (notebook, page, GTK_WIDGET (child));
|
|
|
|
|
}
|
|
|
|
|
else if (type && strcmp (type, "action-start") == 0)
|
|
|
|
|
{
|
|
|
|
|
gtk_notebook_set_action_widget (notebook, GTK_WIDGET (child), GTK_PACK_START);
|
|
|
|
|
}
|
|
|
|
|
else if (type && strcmp (type, "action-end") == 0)
|
|
|
|
|
{
|
|
|
|
|
gtk_notebook_set_action_widget (notebook, GTK_WIDGET (child), GTK_PACK_END);
|
|
|
|
|
}
|
|
|
|
|
else if (!type)
|
|
|
|
|
gtk_notebook_append_page (notebook, GTK_WIDGET (child), NULL);
|
|
|
|
|
else
|
|
|
|
|
GTK_BUILDER_WARN_INVALID_CHILD_TYPE (notebook, type);
|
2009-11-09 02:34:29 +00:00
|
|
|
|
}
|
2018-03-08 02:13:57 +00:00
|
|
|
|
else
|
2009-11-09 02:34:29 +00:00
|
|
|
|
{
|
2018-03-08 02:13:57 +00:00
|
|
|
|
parent_buildable_iface->add_child (buildable, builder, child, type);
|
2009-11-09 02:34:29 +00:00
|
|
|
|
}
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_has_current_page (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
return priv->cur_page &&
|
|
|
|
|
gtk_widget_get_visible (priv->cur_page->child);
|
|
|
|
|
}
|
|
|
|
|
|
2002-01-17 00:34:58 +00:00
|
|
|
|
static gboolean
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
gtk_notebook_select_page (GtkNotebook *notebook,
|
|
|
|
|
gboolean move_focus)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
if (gtk_widget_is_focus (GTK_WIDGET (notebook)) && priv->show_tabs)
|
2002-01-17 00:34:58 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_page_select (notebook, move_focus);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-01-17 00:34:58 +00:00
|
|
|
|
static gboolean
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
gtk_notebook_focus_tab (GtkNotebook *notebook,
|
|
|
|
|
GtkNotebookTab type)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
GList *list;
|
2002-01-17 00:34:58 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (gtk_widget_is_focus (GTK_WIDGET (notebook)) && priv->show_tabs)
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
{
|
2002-01-17 00:34:58 +00:00
|
|
|
|
switch (type)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_NOTEBOOK_TAB_FIRST:
|
|
|
|
|
list = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, TRUE);
|
|
|
|
|
if (list)
|
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, list);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_NOTEBOOK_TAB_LAST:
|
|
|
|
|
list = gtk_notebook_search_page (notebook, NULL, STEP_PREV, TRUE);
|
|
|
|
|
if (list)
|
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, list);
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2002-01-17 00:34:58 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
}
|
2002-01-17 00:34:58 +00:00
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
voc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_previous_line):
(gtk_text_layout_move_iter_to_next_line): fix these two for
invisible text, lots of other stuff still hosed.
* gtk/gtkcolorsel.c (gtk_color_selection_set_change_palette_hook):
new function, replaces the get/set palette stuff. This function
is intended for use by libgnomeui which should set the hook to a
thing which sets the palette in GConf, and we need the
GConf-to-xsettings proxy which will result in the change being
propagated back to the GTK app.
* gtk/gtkaccelgroup.c (gtk_accel_group_add): add note to warning
about unusable signals that it may be because the signal has
parameters.
* gtk/gtkwidget.c (gtk_widget_modify_style): always copy the
style, otherwise gtkrc.c won't know to create a new GtkStyle for
it.
(gtk_widget_modify_color_component): call
gtk_widget_modify_style() so the rc style will get copied.
(gtk_widget_modify_font): ditto
* gtk/gtkrc.c: make a couple variables static
* gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): hide
help button by default, since it does nothing
* gtk/gtkcolorsel.c: add tooltips, work on key navigation, fool
around with UI
* gtk/gtkentry.c (gtk_entry_realize): request enter/leave notify
so we can have tooltips
* gtk/gtkhsv.c (gtk_hsv_realize): request enter/leave notify so we
can have tooltips
* gdk/gdkimage.h: mark gdk_image_new_bitmap with
GDK_ENABLE_BROKEN, because its memory behavior is completely
hosed.
* gtk/gtknotebook.c: remove key press handler, replace with
binding set, add numeric keypad support
* gtk/gtktextview.c (gtk_text_view_class_init): accept KP_Delete
* gtk/gtktext.c (gtk_text_key_press): add a bunch of KP keysyms
* gtk/gtkentry.c (gtk_entry_class_init): accept GDK_KP_Delete in
addition to plain Delete
* gtk/gtktextview.c (gtk_text_view_key_press_event): accept
GDK_KP_Enter in addition to GDK_Return
* gtk/gtkfontsel.c (gtk_font_selection_size_key_press): connect to
activate on entry instead of key press
(gtk_font_selection_on_clist_key_press): get
rid of this signal handler, not needed with new font sel.
* gtk/gtkfilesel.c (gtk_file_selection_key_press): remove a
no-longer-needed emit_stop_by_name(), just return TRUE
* gtk/gtkhscrollbar.c, gtk/gtkvscrollbar.c: remove keybindings
cruft, this widget is no longer focusable.
* gtk/gtkrange.h, gtk/gtkrange.c, gtk/gtkvscale.c,
gtk/gtkhscale.c: Get rid of trough_keys virtual function, add
move_slider action signal, add binding set for vscale/hscale, in
the process support numeric keypad
* gtk/gtkentry.c (gtk_entry_class_init): Add keypad bindings;
make GDK_Return and GDK_KP_Enter activate the entry via
binding set, instead of hardcoded.
2001-04-28 20:18:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-01-02 06:22:37 +00:00
|
|
|
|
static gboolean
|
2001-11-16 22:20:00 +00:00
|
|
|
|
gtk_notebook_change_current_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint offset)
|
2001-11-16 22:20:00 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2001-11-16 22:20:00 +00:00
|
|
|
|
GList *current = NULL;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->show_tabs)
|
2007-01-02 06:22:37 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page)
|
|
|
|
|
current = g_list_find (priv->children, priv->cur_page);
|
2001-11-16 22:20:00 +00:00
|
|
|
|
|
|
|
|
|
while (offset != 0)
|
|
|
|
|
{
|
2006-11-16 12:56:30 +00:00
|
|
|
|
current = gtk_notebook_search_page (notebook, current,
|
|
|
|
|
offset < 0 ? STEP_PREV : STEP_NEXT,
|
|
|
|
|
TRUE);
|
|
|
|
|
|
|
|
|
|
if (!current)
|
|
|
|
|
{
|
2013-06-26 19:33:10 +00:00
|
|
|
|
current = gtk_notebook_search_page (notebook, NULL,
|
|
|
|
|
offset < 0 ? STEP_PREV : STEP_NEXT,
|
|
|
|
|
TRUE);
|
2006-11-16 12:56:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-16 22:20:00 +00:00
|
|
|
|
offset += offset < 0 ? 1 : -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (current)
|
2007-06-03 04:27:56 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, current->data);
|
2002-02-08 01:10:25 +00:00
|
|
|
|
else
|
2006-11-16 12:56:30 +00:00
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (notebook));
|
2007-01-02 06:22:37 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
2002-02-08 01:10:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GtkDirectionType
|
|
|
|
|
get_effective_direction (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
/* Remap the directions into the effective direction it would be for a
|
|
|
|
|
* GTK_POS_TOP notebook
|
|
|
|
|
*/
|
2003-12-08 21:07:17 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
#define D(rest) GTK_DIR_##rest
|
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
static const GtkDirectionType translate_direction[2][4][6] = {
|
|
|
|
|
/* LEFT */ {{ D(TAB_FORWARD), D(TAB_BACKWARD), D(LEFT), D(RIGHT), D(UP), D(DOWN) },
|
2002-02-08 01:10:25 +00:00
|
|
|
|
/* RIGHT */ { D(TAB_BACKWARD), D(TAB_FORWARD), D(LEFT), D(RIGHT), D(DOWN), D(UP) },
|
|
|
|
|
/* TOP */ { D(TAB_FORWARD), D(TAB_BACKWARD), D(UP), D(DOWN), D(LEFT), D(RIGHT) },
|
2003-12-08 21:07:17 +00:00
|
|
|
|
/* BOTTOM */ { D(TAB_BACKWARD), D(TAB_FORWARD), D(DOWN), D(UP), D(LEFT), D(RIGHT) }},
|
|
|
|
|
/* LEFT */ {{ D(TAB_BACKWARD), D(TAB_FORWARD), D(LEFT), D(RIGHT), D(DOWN), D(UP) },
|
|
|
|
|
/* RIGHT */ { D(TAB_FORWARD), D(TAB_BACKWARD), D(LEFT), D(RIGHT), D(UP), D(DOWN) },
|
|
|
|
|
/* TOP */ { D(TAB_FORWARD), D(TAB_BACKWARD), D(UP), D(DOWN), D(RIGHT), D(LEFT) },
|
|
|
|
|
/* BOTTOM */ { D(TAB_BACKWARD), D(TAB_FORWARD), D(DOWN), D(UP), D(RIGHT), D(LEFT) }},
|
2002-02-08 01:10:25 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#undef D
|
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
int text_dir = gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL ? 1 : 0;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return translate_direction[text_dir][priv->tab_pos][direction];
|
2003-12-08 21:07:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-20 17:32:10 +00:00
|
|
|
|
static GtkPositionType
|
2003-12-08 21:07:17 +00:00
|
|
|
|
get_effective_tab_pos (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
switch (priv->tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
return GTK_POS_RIGHT;
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
return GTK_POS_LEFT;
|
|
|
|
|
default: ;
|
|
|
|
|
}
|
2003-12-08 21:07:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return priv->tab_pos;
|
2002-02-08 01:10:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_move_focus_out (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction_type)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2002-02-08 01:10:25 +00:00
|
|
|
|
GtkDirectionType effective_direction = get_effective_direction (notebook, direction_type);
|
|
|
|
|
GtkWidget *toplevel;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2017-02-08 08:00:29 +00:00
|
|
|
|
if (gtk_widget_get_focus_child (GTK_WIDGET (notebook)) && effective_direction == GTK_DIR_UP)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
if (focus_tabs_in (notebook))
|
|
|
|
|
return;
|
|
|
|
|
if (gtk_widget_is_focus (GTK_WIDGET (notebook)) && effective_direction == GTK_DIR_DOWN)
|
|
|
|
|
if (focus_child_in (notebook, GTK_DIR_TAB_FORWARD))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* At this point, we know we should be focusing out of the notebook entirely. We
|
|
|
|
|
* do this by setting a flag, then propagating the focus motion to the notebook.
|
|
|
|
|
*/
|
|
|
|
|
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (notebook));
|
2010-01-04 06:49:26 +00:00
|
|
|
|
if (!gtk_widget_is_toplevel (toplevel))
|
2002-02-08 01:10:25 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
g_object_ref (notebook);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
priv->focus_out = TRUE;
|
2008-08-11 11:52:06 +00:00
|
|
|
|
g_signal_emit_by_name (toplevel, "move-focus", direction_type);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->focus_out = FALSE;
|
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
g_object_unref (notebook);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
reorder_tab (GtkNotebook *notebook, GList *position, GList *tab)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GList *elem;
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
if (position == tab)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return g_list_position (priv->children, tab);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/* check that we aren't inserting the tab in the
|
|
|
|
|
* same relative position, taking packing into account */
|
2010-07-13 15:47:05 +00:00
|
|
|
|
elem = (position) ? position->prev : g_list_last (priv->children);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (elem == tab)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return g_list_position (priv->children, tab);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
/* now actually reorder the tab */
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->first_tab == tab)
|
|
|
|
|
priv->first_tab = gtk_notebook_search_page (notebook, priv->first_tab,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
STEP_NEXT, TRUE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->children = g_list_remove_link (priv->children, tab);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (!position)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
elem = g_list_last (priv->children);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
elem = position->prev;
|
|
|
|
|
position->prev = tab;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (elem)
|
|
|
|
|
elem->next = tab;
|
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->children = tab;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
tab->prev = elem;
|
|
|
|
|
tab->next = position;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return g_list_position (priv->children, tab);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-01-02 06:22:37 +00:00
|
|
|
|
static gboolean
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gtk_notebook_reorder_tab (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction_type,
|
|
|
|
|
gboolean move_to_last)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkDirectionType effective_direction = get_effective_direction (notebook, direction_type);
|
2016-02-29 22:17:00 +00:00
|
|
|
|
GList *last, *child, *element;
|
|
|
|
|
gint page_num, old_page_num, i;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!gtk_widget_is_focus (GTK_WIDGET (notebook)) || !priv->show_tabs)
|
2007-01-02 06:22:37 +00:00
|
|
|
|
return FALSE;
|
2006-10-08 19:00:31 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (!gtk_notebook_has_current_page (notebook) ||
|
2010-07-13 15:47:05 +00:00
|
|
|
|
!priv->cur_page->reorderable)
|
2007-01-02 06:22:37 +00:00
|
|
|
|
return FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (effective_direction != GTK_DIR_LEFT &&
|
|
|
|
|
effective_direction != GTK_DIR_RIGHT)
|
2007-01-02 06:22:37 +00:00
|
|
|
|
return FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (move_to_last)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
child = priv->focus_tab;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
do
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
last = child;
|
|
|
|
|
child = gtk_notebook_search_page (notebook, last,
|
|
|
|
|
(effective_direction == GTK_DIR_RIGHT) ? STEP_NEXT : STEP_PREV,
|
|
|
|
|
TRUE);
|
|
|
|
|
}
|
2011-01-04 06:23:05 +00:00
|
|
|
|
while (child);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
child = last;
|
|
|
|
|
}
|
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
child = gtk_notebook_search_page (notebook, priv->focus_tab,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
(effective_direction == GTK_DIR_RIGHT) ? STEP_NEXT : STEP_PREV,
|
|
|
|
|
TRUE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!child || child->data == priv->cur_page)
|
2007-01-02 06:22:37 +00:00
|
|
|
|
return FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2016-02-29 22:17:00 +00:00
|
|
|
|
old_page_num = g_list_position (priv->children, priv->focus_tab);
|
2011-01-04 06:23:05 +00:00
|
|
|
|
if (effective_direction == GTK_DIR_RIGHT)
|
|
|
|
|
page_num = reorder_tab (notebook, child->next, priv->focus_tab);
|
|
|
|
|
else
|
|
|
|
|
page_num = reorder_tab (notebook, child, priv->focus_tab);
|
2016-02-29 22:17:00 +00:00
|
|
|
|
|
|
|
|
|
gtk_notebook_child_reordered (notebook, priv->focus_tab->data);
|
|
|
|
|
for (element = priv->children, i = 0; element; element = element->next, i++)
|
|
|
|
|
{
|
|
|
|
|
if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num))
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (element->data), "position");
|
2016-02-29 22:17:00 +00:00
|
|
|
|
}
|
2011-01-04 06:23:05 +00:00
|
|
|
|
g_signal_emit (notebook,
|
|
|
|
|
notebook_signals[PAGE_REORDERED],
|
|
|
|
|
0,
|
|
|
|
|
((GtkNotebookPage *) priv->focus_tab->data)->child,
|
|
|
|
|
page_num);
|
2007-01-02 06:22:37 +00:00
|
|
|
|
|
2011-01-04 06:23:05 +00:00
|
|
|
|
return TRUE;
|
2001-11-16 22:20:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_new:
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Creates a new #GtkNotebook widget with no pages.
|
|
|
|
|
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the newly created #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_notebook_new (void)
|
|
|
|
|
{
|
2002-10-05 23:15:39 +00:00
|
|
|
|
return g_object_new (GTK_TYPE_NOTEBOOK, NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
/* Private GObject Methods :
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_set_property
|
|
|
|
|
* gtk_notebook_get_property
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
*/
|
|
|
|
|
static void
|
2001-05-17 16:22:06 +00:00
|
|
|
|
gtk_notebook_set_property (GObject *object,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1998-07-16 20:23:12 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook;
|
|
|
|
|
|
|
|
|
|
notebook = GTK_NOTEBOOK (object);
|
|
|
|
|
|
2001-05-17 16:22:06 +00:00
|
|
|
|
switch (prop_id)
|
1998-07-16 20:23:12 +00:00
|
|
|
|
{
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SHOW_TABS:
|
|
|
|
|
gtk_notebook_set_show_tabs (notebook, g_value_get_boolean (value));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SHOW_BORDER:
|
|
|
|
|
gtk_notebook_set_show_border (notebook, g_value_get_boolean (value));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SCROLLABLE:
|
|
|
|
|
gtk_notebook_set_scrollable (notebook, g_value_get_boolean (value));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ENABLE_POPUP:
|
|
|
|
|
if (g_value_get_boolean (value))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_popup_enable (notebook);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_popup_disable (notebook);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_PAGE:
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_notebook_set_current_page (notebook, g_value_get_int (value));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_TAB_POS:
|
|
|
|
|
gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2010-09-24 15:13:30 +00:00
|
|
|
|
case PROP_GROUP_NAME:
|
|
|
|
|
gtk_notebook_set_group_name (notebook, g_value_get_string (value));
|
2007-05-19 05:22:00 +00:00
|
|
|
|
break;
|
1998-07-16 20:23:12 +00:00
|
|
|
|
default:
|
2008-01-06 03:28:40 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-05-17 16:22:06 +00:00
|
|
|
|
gtk_notebook_get_property (GObject *object,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1998-07-16 20:23:12 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
1998-07-16 20:23:12 +00:00
|
|
|
|
|
2001-05-17 16:22:06 +00:00
|
|
|
|
switch (prop_id)
|
1998-07-16 20:23:12 +00:00
|
|
|
|
{
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SHOW_TABS:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_value_set_boolean (value, priv->show_tabs);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SHOW_BORDER:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_value_set_boolean (value, priv->show_border);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_SCROLLABLE:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_value_set_boolean (value, priv->scrollable);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_ENABLE_POPUP:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_value_set_boolean (value, priv->menu != NULL);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_PAGE:
|
|
|
|
|
g_value_set_int (value, gtk_notebook_get_current_page (notebook));
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
case PROP_TAB_POS:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_value_set_enum (value, priv->tab_pos);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
2010-09-24 15:13:30 +00:00
|
|
|
|
case PROP_GROUP_NAME:
|
|
|
|
|
g_value_set_string (value, gtk_notebook_get_group_name (notebook));
|
2006-02-23 17:59:33 +00:00
|
|
|
|
break;
|
2019-02-21 02:46:20 +00:00
|
|
|
|
case PROP_PAGES:
|
|
|
|
|
g_value_set_object (value, gtk_notebook_get_pages (notebook));
|
|
|
|
|
break;
|
1998-07-16 20:23:12 +00:00
|
|
|
|
default:
|
2001-05-17 16:22:06 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
/* Private GtkWidget Methods :
|
2010-09-18 23:55:42 +00:00
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_destroy
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_map
|
|
|
|
|
* gtk_notebook_unmap
|
2016-12-14 04:25:00 +00:00
|
|
|
|
* gtk_notebook_snapshot
|
2006-02-22 16:35:09 +00:00
|
|
|
|
* gtk_notebook_popup_menu
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* gtk_notebook_drag_begin
|
2006-06-15 18:46:03 +00:00
|
|
|
|
* gtk_notebook_drag_end
|
2006-12-28 16:38:49 +00:00
|
|
|
|
* gtk_notebook_drag_failed
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* gtk_notebook_drag_motion
|
|
|
|
|
* gtk_notebook_drag_drop
|
|
|
|
|
* gtk_notebook_drag_data_get
|
|
|
|
|
* gtk_notebook_drag_data_received
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
*/
|
2012-09-19 21:01:00 +00:00
|
|
|
|
static void
|
|
|
|
|
remove_switch_tab_timer (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->switch_tab_timer)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->switch_tab_timer);
|
|
|
|
|
priv->switch_tab_timer = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_destroy (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
2019-02-21 02:46:20 +00:00
|
|
|
|
if (priv->pages)
|
|
|
|
|
g_list_model_items_changed (G_LIST_MODEL (priv->pages), 0, g_list_length (priv->children), 0);
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
if (priv->menu)
|
|
|
|
|
gtk_notebook_popup_disable (notebook);
|
|
|
|
|
|
|
|
|
|
if (priv->source_targets)
|
|
|
|
|
{
|
2017-11-18 01:19:53 +00:00
|
|
|
|
gdk_content_formats_unref (priv->source_targets);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
priv->source_targets = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-15 11:58:14 +00:00
|
|
|
|
remove_switch_tab_timer (notebook);
|
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->destroy (widget);
|
2016-06-05 23:35:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (object);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2016-01-15 11:58:14 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_unparent (priv->box);
|
2016-06-05 23:35:12 +00:00
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_notebook_parent_class)->finalize (object);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_dispose (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (object);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GList *l = priv->children;
|
|
|
|
|
|
|
|
|
|
while (l != NULL)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = l->data;
|
|
|
|
|
l = l->next;
|
|
|
|
|
|
|
|
|
|
gtk_notebook_remove (GTK_CONTAINER (notebook), page->child);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_notebook_parent_class)->dispose (object);
|
|
|
|
|
}
|
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static gboolean
|
2018-04-07 08:02:02 +00:00
|
|
|
|
gtk_notebook_get_tab_area_position (GtkNotebook *notebook,
|
|
|
|
|
graphene_rect_t *rectangle)
|
2001-11-15 21:04:51 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (priv->show_tabs && gtk_notebook_has_current_page (notebook))
|
2002-09-27 20:19:16 +00:00
|
|
|
|
{
|
2019-02-20 03:53:47 +00:00
|
|
|
|
return gtk_widget_compute_bounds (priv->header_widget,
|
|
|
|
|
GTK_WIDGET (notebook),
|
|
|
|
|
rectangle);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_init_from_rect (rectangle, graphene_rect_zero ());
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_unmap (GtkWidget *widget)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
|
|
|
|
|
stop_scrolling (notebook);
|
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->unmap (widget);
|
1998-07-16 20:23:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_distribute_arrow_width (GtkNotebook *notebook,
|
|
|
|
|
GtkPackType type,
|
|
|
|
|
gint size,
|
|
|
|
|
gint *out_left,
|
|
|
|
|
gint *out_right)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GtkRequestedSize sizes[2];
|
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type + 1] == NULL)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type] == NULL)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
*out_left = 0;
|
|
|
|
|
else
|
|
|
|
|
*out_left = size;
|
|
|
|
|
*out_right = 0;
|
|
|
|
|
}
|
2017-05-11 05:48:46 +00:00
|
|
|
|
else if (priv->arrow_widget[2 * type] == NULL)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
*out_left = 0;
|
|
|
|
|
*out_right = size;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type],
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&sizes[0].minimum_size, &sizes[0].natural_size,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type + 1],
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&sizes[1].minimum_size, &sizes[1].natural_size,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
|
|
|
|
|
size -= sizes[0].minimum_size + sizes[1].minimum_size;
|
|
|
|
|
size = gtk_distribute_natural_allocation (size, G_N_ELEMENTS (sizes), sizes);
|
|
|
|
|
|
|
|
|
|
*out_left = sizes[0].minimum_size + size / 2;
|
|
|
|
|
*out_right = sizes[1].minimum_size + (size + 1) / 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_measure_arrows (GtkNotebook *notebook,
|
|
|
|
|
GtkPackType type,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
gint child1_min, child1_nat;
|
|
|
|
|
gint child2_min, child2_nat;
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type],
|
|
|
|
|
orientation,
|
|
|
|
|
for_size,
|
|
|
|
|
&child1_min, &child1_nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
child1_min = child1_nat = 0;
|
|
|
|
|
}
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type + 1])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type + 1],
|
|
|
|
|
orientation,
|
|
|
|
|
for_size,
|
|
|
|
|
&child2_min, &child2_nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
child2_min = child2_nat = 0;
|
|
|
|
|
}
|
|
|
|
|
*minimum = child1_min + child2_min;
|
|
|
|
|
*natural = child1_nat + child2_nat;
|
|
|
|
|
if (minimum_baseline)
|
|
|
|
|
*minimum_baseline = -1;
|
|
|
|
|
if (natural_baseline)
|
|
|
|
|
*natural_baseline = -1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gint child1_size, child2_size;
|
|
|
|
|
|
|
|
|
|
if (for_size > -1)
|
|
|
|
|
gtk_notebook_distribute_arrow_width (notebook, type, for_size, &child1_size, &child2_size);
|
|
|
|
|
else
|
|
|
|
|
child1_size = child2_size = for_size;
|
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type],
|
|
|
|
|
orientation,
|
|
|
|
|
child1_size,
|
|
|
|
|
&child1_min, &child1_nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
child1_min = child1_nat = 0;
|
|
|
|
|
}
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2 * type + 1])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[2 * type + 1],
|
|
|
|
|
orientation,
|
|
|
|
|
child2_size,
|
|
|
|
|
&child2_min, &child2_nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
child2_min = child2_nat = 0;
|
|
|
|
|
}
|
|
|
|
|
*minimum = MAX (child1_min, child2_min);
|
|
|
|
|
*natural = MAX (child1_nat, child2_nat);
|
|
|
|
|
if (minimum_baseline)
|
|
|
|
|
*minimum_baseline = -1;
|
|
|
|
|
if (natural_baseline)
|
|
|
|
|
*natural_baseline = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void
|
2011-06-01 21:20:58 +00:00
|
|
|
|
gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
|
|
|
|
|
GtkRequisition *requisition)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2016-01-06 16:41:41 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2011-06-01 21:20:58 +00:00
|
|
|
|
gint tab_width = 0;
|
|
|
|
|
gint tab_height = 0;
|
|
|
|
|
gint tab_max = 0;
|
|
|
|
|
guint vis_pages = 0;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *children;
|
2011-06-01 21:20:58 +00:00
|
|
|
|
GtkNotebookPage *page;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2006-05-10 14:02:20 +00:00
|
|
|
|
|
2011-06-01 21:20:58 +00:00
|
|
|
|
for (children = priv->children; children;
|
|
|
|
|
children = children->next)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
|
|
|
|
|
if (gtk_widget_get_visible (page->child))
|
|
|
|
|
{
|
|
|
|
|
vis_pages++;
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_visible (page->tab_label))
|
|
|
|
|
gtk_widget_show (page->tab_label);
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_measure (page->tab_widget,
|
2017-05-11 06:50:49 +00:00
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&page->requisition.width, NULL,
|
|
|
|
|
NULL, NULL);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_measure (page->tab_widget,
|
2017-05-11 06:50:49 +00:00
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
page->requisition.width,
|
|
|
|
|
&page->requisition.height, NULL,
|
|
|
|
|
NULL, NULL);
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
|
|
|
|
switch (priv->tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
tab_height = MAX (tab_height, page->requisition.height);
|
|
|
|
|
tab_max = MAX (tab_max, page->requisition.width);
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
tab_width = MAX (tab_width, page->requisition.width);
|
|
|
|
|
tab_max = MAX (tab_max, page->requisition.height);
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2011-06-01 21:20:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (gtk_widget_get_visible (page->tab_label))
|
|
|
|
|
gtk_widget_hide (page->tab_label);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
children = priv->children;
|
|
|
|
|
|
|
|
|
|
if (vis_pages)
|
|
|
|
|
{
|
|
|
|
|
switch (priv->tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
if (tab_height == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (priv->scrollable)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gint arrow_height, unused;
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_START,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
&arrow_height, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_height = MAX (tab_height, arrow_height);
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_END,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
-1,
|
|
|
|
|
&arrow_height, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_height = MAX (tab_height, arrow_height);
|
|
|
|
|
}
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_visible (page->child))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
tab_width += page->requisition.width;
|
|
|
|
|
page->requisition.height = tab_height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->scrollable)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gint start_arrow_width, end_arrow_width, unused;
|
|
|
|
|
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_START,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
tab_height,
|
|
|
|
|
&start_arrow_width, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_END,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
tab_height,
|
|
|
|
|
&end_arrow_width, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_width = MIN (tab_width,
|
|
|
|
|
tab_max + start_arrow_width + end_arrow_width);
|
|
|
|
|
}
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
2015-12-24 14:26:11 +00:00
|
|
|
|
requisition->width = tab_width;
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
|
|
|
|
requisition->height = tab_height;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
if (tab_width == 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (priv->scrollable)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gint arrow_width, unused;
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_START,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&arrow_width, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_width = MAX (tab_width, arrow_width);
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_END,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
-1,
|
|
|
|
|
&arrow_width, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_width = MAX (tab_width, arrow_width);
|
|
|
|
|
}
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_visible (page->child))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
page->requisition.width = tab_width;
|
|
|
|
|
|
|
|
|
|
tab_height += page->requisition.height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->scrollable)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gint start_arrow_height, end_arrow_height, unused;
|
|
|
|
|
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_START,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
tab_width,
|
|
|
|
|
&start_arrow_height, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_END,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
tab_width,
|
|
|
|
|
&end_arrow_height, &unused,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
tab_height = MIN (tab_height, tab_max + start_arrow_height + end_arrow_height);
|
|
|
|
|
}
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
2015-12-24 14:26:11 +00:00
|
|
|
|
requisition->height = tab_height;
|
2015-12-17 01:39:24 +00:00
|
|
|
|
requisition->height = MAX (requisition->height, tab_max);
|
2011-06-01 21:20:58 +00:00
|
|
|
|
|
|
|
|
|
requisition->width = tab_width;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
requisition->width = 0;
|
|
|
|
|
requisition->height = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
requisition->width = 0;
|
|
|
|
|
requisition->height = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-19 21:25:34 +00:00
|
|
|
|
static void
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gtk_notebook_measure_tabs (GtkGizmo *gizmo,
|
2015-12-24 14:26:11 +00:00
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gint *natural_baseline)
|
2015-12-19 21:25:34 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (gizmo)));
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (gtk_widget_get_parent (widget));
|
2016-01-13 16:30:02 +00:00
|
|
|
|
GtkRequisition tabs_requisition = { 0 };
|
2015-12-19 21:25:34 +00:00
|
|
|
|
|
|
|
|
|
gtk_notebook_get_preferred_tabs_size (notebook, &tabs_requisition);
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
*minimum = tabs_requisition.width;
|
|
|
|
|
*natural = tabs_requisition.width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*minimum = tabs_requisition.height;
|
|
|
|
|
*natural = tabs_requisition.height;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-27 05:35:04 +00:00
|
|
|
|
static void
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_notebook_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2010-10-27 05:35:04 +00:00
|
|
|
|
{
|
2015-12-17 23:47:03 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_measure (priv->box,
|
|
|
|
|
orientation,
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
minimum_baseline, natural_baseline);
|
2010-10-27 05:35:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-19 21:25:34 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_allocate_tabs (GtkGizmo *gizmo,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2015-12-19 21:25:34 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (gizmo)));
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (gtk_widget_get_parent (widget));
|
2015-12-19 21:25:34 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_pages_allocate (notebook, width, height);
|
2015-12-19 21:25:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-02-19 05:13:46 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2001-11-16 19:19:30 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->box,
|
|
|
|
|
&(GtkAllocation) {
|
|
|
|
|
0, 0,
|
|
|
|
|
width, height
|
|
|
|
|
}, -1);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_show_arrows (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
GList *children;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
if (!priv->scrollable)
|
2001-11-15 21:04:51 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = children->data;
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
if (!gtk_widget_get_child_visible (page->tab_widget))
|
|
|
|
|
return TRUE;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
|
|
|
|
children = children->next;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
return FALSE;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-05-22 22:34:31 +00:00
|
|
|
|
static GtkNotebookArrow
|
2001-11-15 21:04:51 +00:00
|
|
|
|
gtk_notebook_get_arrow (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
2001-11-15 21:04:51 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2003-05-22 22:34:31 +00:00
|
|
|
|
gint i;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
|
|
|
|
if (gtk_notebook_show_arrows (notebook))
|
|
|
|
|
{
|
2011-01-04 07:21:38 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t arrow_bounds;
|
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[i] == NULL)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->arrow_widget[i],
|
|
|
|
|
GTK_WIDGET (notebook),
|
|
|
|
|
&arrow_bounds))
|
|
|
|
|
continue;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2018-04-07 08:02:02 +00:00
|
|
|
|
if (graphene_rect_contains_point (&arrow_bounds,
|
|
|
|
|
&(graphene_point_t){x, y}))
|
2015-12-25 22:44:08 +00:00
|
|
|
|
return i;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
2003-05-22 22:34:31 +00:00
|
|
|
|
|
|
|
|
|
return ARROW_NONE;
|
2001-11-15 21:04:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-07 15:39:31 +00:00
|
|
|
|
static void
|
2003-05-22 22:34:31 +00:00
|
|
|
|
gtk_notebook_do_arrow (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookArrow arrow)
|
2002-03-07 15:39:31 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2002-03-07 15:39:31 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (notebook);
|
2003-12-08 21:07:17 +00:00
|
|
|
|
gboolean is_rtl, left;
|
|
|
|
|
|
|
|
|
|
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
left = (ARROW_IS_LEFT (arrow) && !is_rtl) ||
|
2003-12-08 21:07:17 +00:00
|
|
|
|
(!ARROW_IS_LEFT (arrow) && is_rtl);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->focus_tab ||
|
|
|
|
|
gtk_notebook_search_page (notebook, priv->focus_tab,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
left ? STEP_PREV : STEP_NEXT,
|
|
|
|
|
TRUE))
|
2002-03-07 15:39:31 +00:00
|
|
|
|
{
|
2008-08-20 08:17:35 +00:00
|
|
|
|
gtk_notebook_change_current_page (notebook, left ? -1 : 1);
|
2006-12-26 11:02:15 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
2002-03-07 15:39:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
static gboolean
|
2003-05-22 22:34:31 +00:00
|
|
|
|
gtk_notebook_arrow_button_press (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookArrow arrow,
|
|
|
|
|
gint button)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (notebook);
|
2003-12-08 21:07:17 +00:00
|
|
|
|
gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean left = (ARROW_IS_LEFT (arrow) && !is_rtl) ||
|
2003-12-08 21:07:17 +00:00
|
|
|
|
(!ARROW_IS_LEFT (arrow) && is_rtl);
|
|
|
|
|
|
2016-01-20 18:52:01 +00:00
|
|
|
|
if (priv->pressed_button)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->pressed_button = button;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->click_child = arrow;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
2012-01-25 17:40:32 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2002-03-07 15:39:31 +00:00
|
|
|
|
gtk_notebook_do_arrow (notebook, arrow);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gtk_notebook_set_scroll_timer (notebook);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
2012-01-25 17:40:32 +00:00
|
|
|
|
else if (button == GDK_BUTTON_MIDDLE)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_page_select (notebook, TRUE);
|
2012-01-25 17:40:32 +00:00
|
|
|
|
else if (button == GDK_BUTTON_SECONDARY)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_search_page (notebook,
|
|
|
|
|
NULL,
|
|
|
|
|
left ? STEP_NEXT : STEP_PREV,
|
|
|
|
|
TRUE));
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_page_tab_label_is_visible (GtkNotebookPage *page)
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
return page->tab_label &&
|
2017-07-05 14:04:59 +00:00
|
|
|
|
gtk_widget_get_visible (page->tab_widget) &&
|
|
|
|
|
gtk_widget_get_child_visible (page->tab_widget) &&
|
|
|
|
|
gtk_widget_get_visible (page->tab_label) &&
|
|
|
|
|
gtk_widget_get_child_visible (page->tab_label);
|
2015-12-25 01:39:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-07 23:26:39 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
in_tabs (GtkNotebook *notebook,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t tabs_bounds;
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->tabs_widget, GTK_WIDGET (notebook), &tabs_bounds))
|
|
|
|
|
return FALSE;
|
2017-10-07 23:26:39 +00:00
|
|
|
|
|
2018-04-07 08:02:02 +00:00
|
|
|
|
return graphene_rect_contains_point (&tabs_bounds,
|
|
|
|
|
&(graphene_point_t){x, y});
|
2017-10-07 23:26:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
static GList*
|
2015-12-07 15:32:15 +00:00
|
|
|
|
get_tab_at_pos (GtkNotebook *notebook,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y)
|
2006-03-22 20:17:23 +00:00
|
|
|
|
{
|
2015-12-25 01:39:43 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GList *children;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
for (children = priv->children; children; children = children->next)
|
2006-03-22 20:17:23 +00:00
|
|
|
|
{
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t bounds;
|
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
page = children->data;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
if (!gtk_notebook_page_tab_label_is_visible (page))
|
|
|
|
|
continue;
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (page->tab_widget, GTK_WIDGET (notebook), &bounds))
|
|
|
|
|
continue;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
2018-04-07 08:02:02 +00:00
|
|
|
|
if (graphene_rect_contains_point (&bounds, &(graphene_point_t){x, y}))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return children;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = user_data;
|
|
|
|
|
GtkWidget *widget = user_data;
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2016-11-03 20:02:53 +00:00
|
|
|
|
GdkEventSequence *sequence;
|
|
|
|
|
GtkNotebookArrow arrow;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2016-11-03 20:02:53 +00:00
|
|
|
|
const GdkEvent *event;
|
|
|
|
|
guint button;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
GList *tab;
|
2016-11-03 20:02:53 +00:00
|
|
|
|
|
|
|
|
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2018-02-02 14:22:22 +00:00
|
|
|
|
if (!priv->children)
|
2016-11-03 20:02:53 +00:00
|
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2001-11-24 00:24:18 +00:00
|
|
|
|
arrow = gtk_notebook_get_arrow (notebook, x, y);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
if (arrow != ARROW_NONE)
|
2016-11-03 20:02:53 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_arrow_button_press (notebook, arrow, button);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2001-11-15 21:04:51 +00:00
|
|
|
|
|
2017-10-07 23:26:39 +00:00
|
|
|
|
if (in_tabs (notebook, x, y) && priv->menu && gdk_event_triggers_context_menu (event))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2016-11-03 20:02:53 +00:00
|
|
|
|
gtk_menu_popup_at_pointer (GTK_MENU (priv->menu), event);
|
|
|
|
|
return;
|
1998-07-16 20:23:12 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
if (button != GDK_BUTTON_PRIMARY)
|
|
|
|
|
return;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
if ((tab = get_tab_at_pos (notebook, x, y)) != NULL)
|
2001-11-15 21:04:51 +00:00
|
|
|
|
{
|
2006-03-22 20:17:23 +00:00
|
|
|
|
gboolean page_changed, was_focus;
|
|
|
|
|
|
|
|
|
|
page = tab->data;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page_changed = page != priv->cur_page;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
was_focus = gtk_widget_is_focus (widget);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, tab);
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
if (page_changed && !was_focus)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_widget_child_focus (page->child, GTK_DIR_TAB_FORWARD);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
/* save press to possibly begin a drag */
|
|
|
|
|
if (page->reorderable || page->detachable)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t tab_bounds;
|
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
priv->pressed_button = button;
|
2016-05-02 08:19:12 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
priv->drag_begin_x = priv->mouse_x;
|
|
|
|
|
priv->drag_begin_y = priv->mouse_y;
|
2016-01-07 11:28:24 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
/* tab bounds get set to empty, which is fine */
|
|
|
|
|
priv->drag_offset_x = priv->drag_begin_x;
|
|
|
|
|
priv->drag_offset_y = priv->drag_begin_y;
|
|
|
|
|
if (gtk_widget_compute_bounds (page->tab_widget, GTK_WIDGET (notebook), &tab_bounds))
|
|
|
|
|
{
|
|
|
|
|
priv->drag_offset_x -= tab_bounds.origin.x;
|
|
|
|
|
priv->drag_offset_y -= tab_bounds.origin.y;
|
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
1998-07-16 20:23:12 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
|
2006-02-22 16:35:09 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_popup_menu (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2016-07-12 18:08:36 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
GtkWidget *tab_label = NULL;
|
2006-02-22 16:35:09 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu)
|
2006-02-22 16:35:09 +00:00
|
|
|
|
{
|
2016-07-12 18:08:36 +00:00
|
|
|
|
if (priv->focus_tab)
|
|
|
|
|
{
|
|
|
|
|
page = priv->focus_tab->data;
|
|
|
|
|
tab_label = page->tab_label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tab_label)
|
|
|
|
|
{
|
|
|
|
|
g_object_set (priv->menu,
|
|
|
|
|
"anchor-hints", (GDK_ANCHOR_FLIP_Y |
|
|
|
|
|
GDK_ANCHOR_SLIDE |
|
|
|
|
|
GDK_ANCHOR_RESIZE),
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
gtk_menu_popup_at_widget (GTK_MENU (priv->menu),
|
|
|
|
|
tab_label,
|
|
|
|
|
GDK_GRAVITY_SOUTH_WEST,
|
|
|
|
|
GDK_GRAVITY_NORTH_WEST,
|
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
g_object_set (priv->menu,
|
|
|
|
|
"anchor-hints", (GDK_ANCHOR_SLIDE |
|
|
|
|
|
GDK_ANCHOR_RESIZE),
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
gtk_menu_popup_at_widget (GTK_MENU (priv->menu),
|
|
|
|
|
widget,
|
|
|
|
|
GDK_GRAVITY_NORTH_WEST,
|
|
|
|
|
GDK_GRAVITY_NORTH_WEST,
|
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_menu_shell_select_first (GTK_MENU_SHELL (priv->menu), FALSE);
|
2006-02-22 16:35:09 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
static void
|
2003-03-29 00:11:32 +00:00
|
|
|
|
stop_scrolling (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
if (priv->timer)
|
2003-03-29 00:11:32 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_source_remove (priv->timer);
|
|
|
|
|
priv->timer = 0;
|
|
|
|
|
priv->need_timer = FALSE;
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
2016-02-11 11:47:28 +00:00
|
|
|
|
priv->click_child = ARROW_NONE;
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->pressed_button = 0;
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static GList*
|
2011-01-04 06:31:47 +00:00
|
|
|
|
get_drop_position (GtkNotebook *notebook)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GList *children, *last_child;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
gboolean is_rtl;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gint x, y;
|
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
x = priv->mouse_x;
|
|
|
|
|
y = priv->mouse_y;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
is_rtl = gtk_widget_get_direction ((GtkWidget *) notebook) == GTK_TEXT_DIR_RTL;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
last_child = NULL;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
for (children = priv->children; children; children = children->next)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if ((priv->operation != DRAG_OPERATION_REORDER || page != priv->cur_page) &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_widget_get_visible (page->child) &&
|
|
|
|
|
page->tab_label &&
|
|
|
|
|
gtk_widget_get_mapped (page->tab_label))
|
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t tab_bounds;
|
2016-01-07 11:28:24 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (page->tab_widget, GTK_WIDGET (notebook), &tab_bounds))
|
|
|
|
|
continue;
|
2016-01-07 11:28:24 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
switch (priv->tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
if (!is_rtl)
|
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
if (tab_bounds.origin.x + tab_bounds.size.width / 2 > x)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return children;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-04-07 11:37:24 +00:00
|
|
|
|
if (tab_bounds.origin.x + tab_bounds.size.width / 2 < x)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return children;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
2018-04-07 11:37:24 +00:00
|
|
|
|
if (tab_bounds.origin.y + tab_bounds.size.height / 2 > y)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return children;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2011-01-04 07:21:38 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
last_child = children->next;
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
return last_child;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-26 18:56:25 +00:00
|
|
|
|
static void
|
2017-04-12 10:11:56 +00:00
|
|
|
|
tab_drag_begin (GtkNotebook *notebook,
|
|
|
|
|
GtkNotebookPage *page)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_widget), GTK_STYLE_CLASS_DND);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
/* This function undoes the reparenting that happens both when drag_surface
|
2006-05-09 02:36:08 +00:00
|
|
|
|
* is shown for reordering and when the DnD icon is shown for detaching
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2017-04-12 10:11:56 +00:00
|
|
|
|
tab_drag_end (GtkNotebook *notebook,
|
|
|
|
|
GtkNotebookPage *page)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2016-01-20 16:20:03 +00:00
|
|
|
|
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
|
|
|
|
{
|
|
|
|
|
g_object_ref (page->tab_label);
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (page->tab_label)), page->tab_label);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_parent (page->tab_label, page->tab_widget);
|
2016-01-20 16:20:03 +00:00
|
|
|
|
g_object_unref (page->tab_label);
|
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_remove_class (gtk_widget_get_style_context (page->tab_widget), GTK_STYLE_CLASS_DND);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_stop_reorder (GtkNotebook *notebook)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GtkNotebookPage *page;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2006-12-26 11:02:15 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_DETACH)
|
|
|
|
|
page = priv->detached_tab;
|
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page = priv->cur_page;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2008-02-16 04:09:15 +00:00
|
|
|
|
if (!page || !page->tab_label)
|
2006-06-15 18:46:03 +00:00
|
|
|
|
return;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->pressed_button = 0;
|
2006-06-20 11:48:21 +00:00
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
if (page->reorderable || page->detachable)
|
|
|
|
|
{
|
2016-02-02 17:50:58 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
|
|
|
|
{
|
|
|
|
|
gint old_page_num, page_num, i;
|
|
|
|
|
GList *element;
|
2016-01-20 16:37:04 +00:00
|
|
|
|
|
2016-02-02 17:50:58 +00:00
|
|
|
|
element = get_drop_position (notebook);
|
|
|
|
|
old_page_num = g_list_position (priv->children, priv->focus_tab);
|
|
|
|
|
page_num = reorder_tab (notebook, element, priv->focus_tab);
|
|
|
|
|
gtk_notebook_child_reordered (notebook, page);
|
2016-01-20 16:37:04 +00:00
|
|
|
|
|
2016-02-02 17:50:58 +00:00
|
|
|
|
if (priv->has_scrolled || old_page_num != page_num)
|
2016-01-20 16:37:04 +00:00
|
|
|
|
{
|
2016-02-02 17:50:58 +00:00
|
|
|
|
for (element = priv->children, i = 0; element; element = element->next, i++)
|
|
|
|
|
{
|
|
|
|
|
if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num))
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (element->data), "position");
|
2016-02-02 17:50:58 +00:00
|
|
|
|
}
|
|
|
|
|
g_signal_emit (notebook,
|
|
|
|
|
notebook_signals[PAGE_REORDERED], 0,
|
|
|
|
|
page->child, page_num);
|
2016-01-20 16:37:04 +00:00
|
|
|
|
}
|
2016-01-18 14:01:49 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2016-01-20 16:37:04 +00:00
|
|
|
|
priv->has_scrolled = FALSE;
|
|
|
|
|
|
2017-04-12 10:11:56 +00:00
|
|
|
|
tab_drag_end (notebook, page);
|
2016-01-20 16:37:04 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
priv->operation = DRAG_OPERATION_NONE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (priv->dnd_timer)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->dnd_timer);
|
|
|
|
|
priv->dnd_timer = 0;
|
|
|
|
|
}
|
2016-01-11 16:52:38 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_allocate (GTK_WIDGET (notebook));
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
2006-06-15 18:46:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_gesture_released (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
2006-06-15 18:46:03 +00:00
|
|
|
|
{
|
2016-11-03 20:02:53 +00:00
|
|
|
|
GtkNotebook *notebook = user_data;
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GdkEventSequence *sequence;
|
|
|
|
|
const GdkEvent *event;
|
|
|
|
|
guint button;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2017-05-03 09:21:29 +00:00
|
|
|
|
if (!event)
|
|
|
|
|
return;
|
|
|
|
|
|
2016-11-03 20:02:53 +00:00
|
|
|
|
if (priv->pressed_button != button)
|
|
|
|
|
return;
|
2016-01-20 18:52:01 +00:00
|
|
|
|
|
2016-01-20 15:45:40 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER &&
|
2014-12-22 15:52:54 +00:00
|
|
|
|
priv->cur_page &&
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->cur_page->reorderable)
|
2006-06-20 11:48:21 +00:00
|
|
|
|
gtk_notebook_stop_reorder (notebook);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2016-01-20 18:52:01 +00:00
|
|
|
|
stop_scrolling (notebook);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static GtkNotebookPointerPosition
|
|
|
|
|
get_pointer_position (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (notebook);
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t area;
|
2017-04-12 10:11:56 +00:00
|
|
|
|
gint width, height;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gboolean is_rtl;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->scrollable)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
return POINTER_BETWEEN;
|
|
|
|
|
|
2017-04-02 09:00:34 +00:00
|
|
|
|
gtk_notebook_get_tab_area_position (notebook, &area);
|
2018-04-07 08:02:02 +00:00
|
|
|
|
width = area.size.width;
|
|
|
|
|
height = area.size.height;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->tab_pos == GTK_POS_TOP ||
|
|
|
|
|
priv->tab_pos == GTK_POS_BOTTOM)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2017-04-12 10:11:56 +00:00
|
|
|
|
gint x = priv->mouse_x;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
|
|
|
|
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (x > width - SCROLL_THRESHOLD)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return (is_rtl) ? POINTER_BEFORE : POINTER_AFTER;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
else if (x < SCROLL_THRESHOLD)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return (is_rtl) ? POINTER_AFTER : POINTER_BEFORE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return POINTER_BETWEEN;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-04-12 10:11:56 +00:00
|
|
|
|
gint y = priv->mouse_y;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (y > height - SCROLL_THRESHOLD)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return POINTER_AFTER;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
else if (y < SCROLL_THRESHOLD)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return POINTER_BEFORE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return POINTER_BETWEEN;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
scroll_notebook_timer (gpointer data)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkNotebookPointerPosition pointer_position;
|
|
|
|
|
GList *element, *first_tab;
|
|
|
|
|
|
|
|
|
|
pointer_position = get_pointer_position (notebook);
|
|
|
|
|
|
2011-01-04 06:31:47 +00:00
|
|
|
|
element = get_drop_position (notebook);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
reorder_tab (notebook, element, priv->focus_tab);
|
|
|
|
|
first_tab = gtk_notebook_search_page (notebook, priv->first_tab,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
(pointer_position == POINTER_BEFORE) ? STEP_PREV : STEP_NEXT,
|
|
|
|
|
TRUE);
|
2015-03-10 08:34:39 +00:00
|
|
|
|
if (first_tab && priv->cur_page)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->first_tab = first_tab;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->tabs_widget);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
check_threshold (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint current_x,
|
|
|
|
|
gint current_y)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gint dnd_threshold;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t rectangle;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkSettings *settings;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
|
|
|
|
|
g_object_get (G_OBJECT (settings), "gtk-dnd-drag-threshold", &dnd_threshold, NULL);
|
|
|
|
|
|
|
|
|
|
/* we want a large threshold */
|
|
|
|
|
dnd_threshold *= DND_THRESHOLD_MULTIPLIER;
|
|
|
|
|
|
2017-04-02 09:00:34 +00:00
|
|
|
|
gtk_notebook_get_tab_area_position (notebook, &rectangle);
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_inset (&rectangle, -dnd_threshold, -dnd_threshold);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
/* The negation here is important! */
|
2018-04-07 08:02:02 +00:00
|
|
|
|
return !graphene_rect_contains_point (&rectangle, &(graphene_point_t){current_x, current_y});
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-02 21:29:38 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_motion (GtkEventController *controller,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2018-01-02 21:29:38 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (user_data);
|
2001-11-15 21:04:51 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2017-08-25 14:50:30 +00:00
|
|
|
|
guint state;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2018-01-02 21:29:38 +00:00
|
|
|
|
page = priv->cur_page;
|
|
|
|
|
if (!page)
|
|
|
|
|
return;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
2018-04-25 00:10:01 +00:00
|
|
|
|
if (!gtk_get_current_event_state (&state))
|
2018-01-02 21:29:38 +00:00
|
|
|
|
return;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2017-08-25 14:50:30 +00:00
|
|
|
|
if (!(state & GDK_BUTTON1_MASK) &&
|
2016-01-20 18:52:01 +00:00
|
|
|
|
priv->pressed_button != 0)
|
2006-06-15 18:46:03 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_stop_reorder (notebook);
|
|
|
|
|
stop_scrolling (notebook);
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-25 14:50:30 +00:00
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2016-01-20 18:52:01 +00:00
|
|
|
|
if (priv->pressed_button == 0)
|
2018-01-02 21:29:38 +00:00
|
|
|
|
return;
|
2006-08-15 06:59:55 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
if (page->detachable &&
|
2006-06-15 18:46:03 +00:00
|
|
|
|
check_threshold (notebook, priv->mouse_x, priv->mouse_y))
|
2001-11-15 21:04:51 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->detached_tab = priv->cur_page;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2018-07-03 18:37:31 +00:00
|
|
|
|
gtk_drag_begin (widget,
|
|
|
|
|
gtk_get_current_event_device (),
|
|
|
|
|
priv->source_targets, GDK_ACTION_MOVE,
|
|
|
|
|
priv->drag_begin_x, priv->drag_begin_y);
|
2018-01-02 21:29:38 +00:00
|
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
if (page->reorderable &&
|
2016-01-20 16:37:04 +00:00
|
|
|
|
(priv->operation == DRAG_OPERATION_REORDER ||
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_drag_check_threshold (widget, priv->drag_begin_x, priv->drag_begin_y,
|
|
|
|
|
priv->mouse_x, priv->mouse_y)))
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkNotebookPointerPosition pointer_position = get_pointer_position (notebook);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-04-12 10:11:56 +00:00
|
|
|
|
if (pointer_position != POINTER_BETWEEN &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_show_arrows (notebook))
|
|
|
|
|
{
|
|
|
|
|
/* scroll tabs */
|
|
|
|
|
if (!priv->dnd_timer)
|
|
|
|
|
{
|
|
|
|
|
priv->has_scrolled = TRUE;
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->dnd_timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
scroll_notebook_timer,
|
2018-02-02 14:51:47 +00:00
|
|
|
|
notebook);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->dnd_timer, "[gtk] scroll_notebook_timer");
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->dnd_timer)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->dnd_timer);
|
|
|
|
|
priv->dnd_timer = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-04-12 10:11:56 +00:00
|
|
|
|
if (priv->operation != DRAG_OPERATION_REORDER)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2017-04-12 10:11:56 +00:00
|
|
|
|
priv->operation = DRAG_OPERATION_REORDER;
|
|
|
|
|
tab_drag_begin (notebook, page);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->tabs_widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-03-29 00:11:32 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_grab_notify (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean was_grabbed)
|
2003-03-29 00:11:32 +00:00
|
|
|
|
{
|
2006-06-20 11:48:21 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
|
2018-05-14 16:19:44 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->grab_notify (widget, was_grabbed);
|
|
|
|
|
|
2003-03-29 00:11:32 +00:00
|
|
|
|
if (!was_grabbed)
|
2006-06-20 11:48:21 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_stop_reorder (notebook);
|
|
|
|
|
stop_scrolling (notebook);
|
|
|
|
|
}
|
2003-03-29 00:11:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
static void
|
|
|
|
|
update_arrow_state (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
gint i;
|
|
|
|
|
gboolean is_rtl, left;
|
|
|
|
|
|
|
|
|
|
is_rtl = gtk_widget_get_direction (GTK_WIDGET (notebook)) == GTK_TEXT_DIR_RTL;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gboolean sensitive = TRUE;
|
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[i] == NULL)
|
2015-11-08 20:01:09 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
left = (ARROW_IS_LEFT (i) && !is_rtl) ||
|
|
|
|
|
(!ARROW_IS_LEFT (i) && is_rtl);
|
|
|
|
|
|
|
|
|
|
if (priv->focus_tab &&
|
|
|
|
|
!gtk_notebook_search_page (notebook, priv->focus_tab,
|
|
|
|
|
left ? STEP_PREV : STEP_NEXT, TRUE))
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
sensitive = FALSE;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_sensitive (priv->arrow_widget[i], sensitive);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-29 00:11:32 +00:00
|
|
|
|
static void
|
2010-12-13 12:39:53 +00:00
|
|
|
|
gtk_notebook_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state)
|
2003-03-29 00:11:32 +00:00
|
|
|
|
{
|
2010-02-27 04:24:24 +00:00
|
|
|
|
if (!gtk_widget_is_sensitive (widget))
|
2017-05-13 09:38:30 +00:00
|
|
|
|
stop_scrolling (GTK_NOTEBOOK (widget));
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
static void
|
|
|
|
|
update_arrow_nodes (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
gboolean arrow[4];
|
2017-05-13 09:38:30 +00:00
|
|
|
|
const char *up_icon_name;
|
|
|
|
|
const char *down_icon_name;
|
2016-01-06 16:41:41 +00:00
|
|
|
|
gint i;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
if (priv->tab_pos == GTK_POS_LEFT ||
|
|
|
|
|
priv->tab_pos == GTK_POS_RIGHT)
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
up_icon_name = "pan-down-symbolic";
|
|
|
|
|
down_icon_name = "pan-up-symbolic";
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
up_icon_name = "pan-end-symbolic";
|
|
|
|
|
down_icon_name = "pan-start-symbolic";
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-18 10:51:23 +00:00
|
|
|
|
arrow[0] = TRUE;
|
|
|
|
|
arrow[1] = FALSE;
|
|
|
|
|
arrow[2] = FALSE;
|
|
|
|
|
arrow[3] = TRUE;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->scrollable && arrow[i])
|
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[i] == NULL)
|
2015-11-08 20:01:09 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
GtkWidget *next_widget;
|
|
|
|
|
GtkStyleContext *context;
|
2016-01-06 16:41:41 +00:00
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
switch (i)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[1])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
next_widget = priv->arrow_widget[1];
|
2016-01-06 16:41:41 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/* fall through */
|
2015-11-08 20:01:09 +00:00
|
|
|
|
case 1:
|
2016-01-06 16:41:41 +00:00
|
|
|
|
if (priv->children)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = priv->children->data;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
next_widget = page->tab_widget;
|
2016-01-06 16:41:41 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
next_widget = priv->arrow_widget[2];
|
2016-01-06 16:41:41 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/* fall through */
|
2015-11-08 20:01:09 +00:00
|
|
|
|
case 2:
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[3])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
next_widget = priv->arrow_widget[3];
|
2016-01-06 16:41:41 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/* fall through */
|
2015-11-08 20:01:09 +00:00
|
|
|
|
case 3:
|
2017-05-11 05:48:46 +00:00
|
|
|
|
next_widget = NULL;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2017-05-11 05:48:46 +00:00
|
|
|
|
next_widget = NULL;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
priv->arrow_widget[i] = g_object_new (GTK_TYPE_BUTTON,
|
|
|
|
|
"css-name", "arrow",
|
|
|
|
|
NULL);
|
2017-05-11 05:48:46 +00:00
|
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (priv->arrow_widget[i]);
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
if (i == ARROW_LEFT_BEFORE || i == ARROW_LEFT_AFTER)
|
2017-06-27 09:11:57 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_style_context_add_class (context, "down");
|
|
|
|
|
gtk_widget_insert_after (priv->arrow_widget[i], priv->tabs_widget, next_widget);
|
|
|
|
|
}
|
2016-01-06 16:41:41 +00:00
|
|
|
|
else
|
2017-06-27 09:11:57 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_style_context_add_class (context, "up");
|
2017-06-27 09:44:22 +00:00
|
|
|
|
gtk_widget_insert_before (priv->arrow_widget[i], priv->tabs_widget, next_widget);
|
2017-06-27 09:11:57 +00:00
|
|
|
|
}
|
2015-11-08 20:01:09 +00:00
|
|
|
|
}
|
2016-01-06 16:41:41 +00:00
|
|
|
|
|
|
|
|
|
if (i == ARROW_LEFT_BEFORE || i == ARROW_LEFT_AFTER)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_button_set_icon_name (GTK_BUTTON (priv->arrow_widget[i]), down_icon_name);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
else
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_button_set_icon_name (GTK_BUTTON (priv->arrow_widget[i]), up_icon_name);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-11-13 19:53:14 +00:00
|
|
|
|
g_clear_pointer (&priv->arrow_widget[i], gtk_widget_unparent);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gtk_notebook_drag_begin (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t bounds;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
GtkWidget *tab_label;
|
1998-11-06 22:05:02 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
if (priv->dnd_timer)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->dnd_timer);
|
|
|
|
|
priv->dnd_timer = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-10 08:34:39 +00:00
|
|
|
|
g_assert (priv->cur_page != NULL);
|
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
priv->operation = DRAG_OPERATION_DETACH;
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
tab_label = priv->detached_tab->tab_label;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-04-12 10:11:56 +00:00
|
|
|
|
tab_drag_end (notebook, priv->cur_page);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
g_object_ref (tab_label);
|
|
|
|
|
gtk_widget_unparent (tab_label);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
priv->dnd_child = tab_label;
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (gtk_widget_compute_bounds (priv->dnd_child, priv->dnd_child, &bounds))
|
|
|
|
|
gtk_widget_set_size_request (priv->dnd_child,
|
|
|
|
|
ceilf (bounds.size.width),
|
|
|
|
|
ceilf (bounds.size.height));
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (priv->dnd_child), "background");
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
|
gtk_drag_set_icon_widget (drag, tab_label, -2, -2);
|
|
|
|
|
g_object_set_data (G_OBJECT (priv->dnd_child), "drag-context", drag);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
g_object_unref (tab_label);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_drag_end (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag)
|
2006-06-15 18:46:03 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_notebook_stop_reorder (notebook);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2016-03-09 16:43:18 +00:00
|
|
|
|
if (priv->rootwindow_drop)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebook *dest_notebook = NULL;
|
|
|
|
|
gint x, y;
|
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
|
gdk_device_get_position (gdk_drag_get_device (drag), &x, &y);
|
2016-03-09 16:43:18 +00:00
|
|
|
|
g_signal_emit (notebook, notebook_signals[CREATE_WINDOW], 0,
|
|
|
|
|
priv->detached_tab->child, x, y, &dest_notebook);
|
|
|
|
|
|
|
|
|
|
if (dest_notebook)
|
2017-12-05 03:06:20 +00:00
|
|
|
|
do_detach_tab (notebook, dest_notebook, priv->detached_tab->child);
|
2016-03-09 16:43:18 +00:00
|
|
|
|
|
|
|
|
|
priv->rootwindow_drop = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else if (priv->detached_tab)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_set_size_request (priv->dnd_child, -1, -1);
|
|
|
|
|
g_object_ref (priv->dnd_child);
|
|
|
|
|
gtk_widget_unparent (priv->dnd_child);
|
|
|
|
|
gtk_widget_set_parent (priv->dnd_child, priv->detached_tab->tab_widget);
|
|
|
|
|
g_object_unref (priv->dnd_child);
|
|
|
|
|
gtk_notebook_switch_page (notebook, priv->detached_tab);
|
|
|
|
|
}
|
2006-12-26 11:02:15 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_remove_class (gtk_widget_get_style_context (priv->dnd_child), "background");
|
|
|
|
|
priv->dnd_child = NULL;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
|
|
|
|
priv->operation = DRAG_OPERATION_NONE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-06-04 14:39:56 +00:00
|
|
|
|
static GtkNotebook *
|
|
|
|
|
gtk_notebook_create_window (GtkNotebook *notebook,
|
|
|
|
|
GtkWidget *page,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-28 16:38:49 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_drag_failed (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDragResult result)
|
2006-12-28 16:38:49 +00:00
|
|
|
|
{
|
2016-03-09 16:43:18 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
priv->rootwindow_drop = FALSE;
|
|
|
|
|
|
2006-12-28 16:38:49 +00:00
|
|
|
|
if (result == GTK_DRAG_RESULT_NO_TARGET)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *dest_notebook = NULL;
|
2006-12-28 16:38:49 +00:00
|
|
|
|
gint x, y;
|
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
|
gdk_device_get_position (gdk_drag_get_device (drag), &x, &y);
|
2006-12-28 16:38:49 +00:00
|
|
|
|
|
2007-06-04 14:39:56 +00:00
|
|
|
|
g_signal_emit (notebook, notebook_signals[CREATE_WINDOW], 0,
|
|
|
|
|
priv->detached_tab->child, x, y, &dest_notebook);
|
2007-05-19 05:22:00 +00:00
|
|
|
|
|
2006-12-28 16:38:49 +00:00
|
|
|
|
if (dest_notebook)
|
2017-12-05 03:06:20 +00:00
|
|
|
|
do_detach_tab (notebook, dest_notebook, priv->detached_tab->child);
|
2006-12-28 16:38:49 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_notebook_switch_tab_timeout (gpointer data)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2012-09-20 00:56:26 +00:00
|
|
|
|
GList *switch_tab;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
|
|
|
|
priv->switch_tab_timer = 0;
|
|
|
|
|
|
2012-09-20 00:56:26 +00:00
|
|
|
|
switch_tab = priv->switch_tab;
|
|
|
|
|
priv->switch_tab = NULL;
|
|
|
|
|
|
|
|
|
|
if (switch_tab)
|
2006-03-22 20:17:23 +00:00
|
|
|
|
{
|
|
|
|
|
/* FIXME: hack, we don't want the
|
|
|
|
|
* focus to move fom the source widget
|
|
|
|
|
*/
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->child_has_focus = FALSE;
|
2012-09-20 00:56:26 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, switch_tab);
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static gboolean
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gtk_notebook_drag_motion (GtkWidget *widget,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t position;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
GtkNotebookArrow arrow;
|
|
|
|
|
GdkAtom target, tab_target;
|
2012-09-20 00:56:26 +00:00
|
|
|
|
GList *tab;
|
|
|
|
|
gboolean retval = FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
arrow = gtk_notebook_get_arrow (notebook, x, y);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
if (arrow != ARROW_NONE)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->click_child = arrow;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gtk_notebook_set_scroll_timer (notebook);
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gdk_drop_status (drop, 0);
|
2012-09-20 00:56:26 +00:00
|
|
|
|
|
|
|
|
|
retval = TRUE;
|
|
|
|
|
goto out;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stop_scrolling (notebook);
|
2018-05-17 02:51:18 +00:00
|
|
|
|
target = gtk_drag_dest_find_target (widget, drop, NULL);
|
2017-12-14 04:39:03 +00:00
|
|
|
|
tab_target = g_intern_static_string ("GTK_NOTEBOOK_TAB");
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
if (target == tab_target)
|
|
|
|
|
{
|
2010-09-24 15:13:30 +00:00
|
|
|
|
GQuark group, source_group;
|
|
|
|
|
GtkNotebook *source;
|
|
|
|
|
GtkWidget *source_child;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2012-09-20 00:56:26 +00:00
|
|
|
|
retval = TRUE;
|
|
|
|
|
|
2018-05-17 02:51:18 +00:00
|
|
|
|
source = GTK_NOTEBOOK (gtk_drag_get_source_widget (gdk_drop_get_drag (drop)));
|
2015-05-26 14:26:59 +00:00
|
|
|
|
g_assert (source->priv->cur_page != NULL);
|
2010-09-24 15:13:30 +00:00
|
|
|
|
source_child = source->priv->cur_page->child;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
group = notebook->priv->group;
|
|
|
|
|
source_group = source->priv->group;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
if (group != 0 && group == source_group &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
!(widget == source_child ||
|
2010-09-24 15:13:30 +00:00
|
|
|
|
gtk_widget_is_ancestor (widget, source_child)))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gdk_drop_status (drop, GDK_ACTION_MOVE);
|
2012-09-20 00:56:26 +00:00
|
|
|
|
goto out;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2007-05-18 11:07:04 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
/* it's a tab, but doesn't share
|
|
|
|
|
* ID with this notebook */
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gdk_drop_status (drop, 0);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-02 09:00:34 +00:00
|
|
|
|
if (gtk_notebook_get_tab_area_position (notebook, &position) &&
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_contains_point (&position, &(graphene_point_t){x, y}) &&
|
2012-09-20 00:56:26 +00:00
|
|
|
|
(tab = get_tab_at_pos (notebook, x, y)))
|
2006-03-22 20:17:23 +00:00
|
|
|
|
{
|
|
|
|
|
priv->mouse_x = x;
|
|
|
|
|
priv->mouse_y = y;
|
|
|
|
|
|
2012-09-20 00:56:26 +00:00
|
|
|
|
retval = TRUE;
|
|
|
|
|
|
|
|
|
|
if (tab != priv->switch_tab)
|
|
|
|
|
remove_switch_tab_timer (notebook);
|
|
|
|
|
|
|
|
|
|
priv->switch_tab = tab;
|
|
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
|
if (!priv->switch_tab_timer)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->switch_tab_timer = g_timeout_add (TIMEOUT_EXPAND, gtk_notebook_switch_tab_timeout, widget);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->switch_tab_timer, "[gtk] gtk_notebook_switch_tab_timeout");
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-09-19 21:01:00 +00:00
|
|
|
|
remove_switch_tab_timer (notebook);
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-09-20 00:56:26 +00:00
|
|
|
|
out:
|
|
|
|
|
return retval;
|
2006-03-22 20:17:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-05-15 22:59:01 +00:00
|
|
|
|
gtk_notebook_drag_leave (GtkWidget *widget,
|
|
|
|
|
GdkDrop *drop)
|
2006-03-22 20:17:23 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2006-03-22 20:17:23 +00:00
|
|
|
|
|
2012-09-19 21:01:00 +00:00
|
|
|
|
remove_switch_tab_timer (notebook);
|
|
|
|
|
stop_scrolling (notebook);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gtk_notebook_drag_drop (GtkWidget *widget,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2017-12-05 03:06:20 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2007-05-18 11:07:04 +00:00
|
|
|
|
GdkAtom target, tab_target;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2018-05-17 02:51:18 +00:00
|
|
|
|
target = gtk_drag_dest_find_target (widget, drop, NULL);
|
2017-12-14 04:39:03 +00:00
|
|
|
|
tab_target = g_intern_static_string ("GTK_NOTEBOOK_TAB");
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2007-05-18 11:07:04 +00:00
|
|
|
|
if (target == tab_target)
|
|
|
|
|
{
|
2017-12-05 03:06:20 +00:00
|
|
|
|
notebook->priv->mouse_x = x;
|
|
|
|
|
notebook->priv->mouse_y = y;
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gtk_drag_get_data (widget, drop, target);
|
2007-05-18 11:07:04 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2007-05-18 11:07:04 +00:00
|
|
|
|
return FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-12 22:33:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_detach_tab:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child
|
|
|
|
|
*
|
|
|
|
|
* Removes the child from the notebook.
|
|
|
|
|
*
|
|
|
|
|
* This function is very similar to gtk_container_remove(),
|
|
|
|
|
* but additionally informs the notebook that the removal
|
|
|
|
|
* is happening as part of a tab DND operation, which should
|
|
|
|
|
* not be cancelled.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_notebook_detach_tab (GtkNotebook *notebook,
|
|
|
|
|
GtkWidget *child)
|
|
|
|
|
{
|
|
|
|
|
notebook->priv->remove_in_detach = TRUE;
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (notebook), child);
|
|
|
|
|
notebook->priv->remove_in_detach = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static void
|
2017-12-05 03:06:20 +00:00
|
|
|
|
do_detach_tab (GtkNotebook *from,
|
|
|
|
|
GtkNotebook *to,
|
|
|
|
|
GtkWidget *child)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *to_priv = to->priv;
|
2006-03-22 16:11:48 +00:00
|
|
|
|
GtkWidget *tab_label, *menu_label;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gboolean tab_expand, tab_fill, reorderable, detachable;
|
|
|
|
|
GList *element;
|
|
|
|
|
gint page_num;
|
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
menu_label = gtk_notebook_get_menu_label (from, child);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
if (menu_label)
|
|
|
|
|
g_object_ref (menu_label);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
tab_label = gtk_notebook_get_tab_label (from, child);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
if (tab_label)
|
|
|
|
|
g_object_ref (tab_label);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
g_object_ref (child);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
gtk_container_child_get (GTK_CONTAINER (from),
|
2011-01-04 07:21:38 +00:00
|
|
|
|
child,
|
|
|
|
|
"tab-expand", &tab_expand,
|
|
|
|
|
"tab-fill", &tab_fill,
|
|
|
|
|
"reorderable", &reorderable,
|
|
|
|
|
"detachable", &detachable,
|
|
|
|
|
NULL);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2015-02-12 22:33:10 +00:00
|
|
|
|
gtk_notebook_detach_tab (from, child);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2011-01-04 06:31:47 +00:00
|
|
|
|
element = get_drop_position (to);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page_num = g_list_position (to_priv->children, element);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gtk_notebook_insert_page_menu (to, child, tab_label, menu_label, page_num);
|
|
|
|
|
|
|
|
|
|
gtk_container_child_set (GTK_CONTAINER (to), child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"tab-expand", tab_expand,
|
|
|
|
|
"tab-fill", tab_fill,
|
|
|
|
|
"reorderable", reorderable,
|
|
|
|
|
"detachable", detachable,
|
|
|
|
|
NULL);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
if (child)
|
|
|
|
|
g_object_unref (child);
|
|
|
|
|
|
|
|
|
|
if (tab_label)
|
|
|
|
|
g_object_unref (tab_label);
|
|
|
|
|
|
|
|
|
|
if (menu_label)
|
|
|
|
|
g_object_unref (menu_label);
|
|
|
|
|
|
|
|
|
|
gtk_notebook_set_current_page (to, page_num);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_drag_data_get (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag,
|
2018-06-16 02:49:47 +00:00
|
|
|
|
GtkSelectionData *data)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2016-03-09 16:43:18 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-12-15 23:54:22 +00:00
|
|
|
|
GdkAtom target;
|
|
|
|
|
|
|
|
|
|
target = gtk_selection_data_get_target (data);
|
2017-12-14 04:39:03 +00:00
|
|
|
|
if (target == g_intern_static_string ("GTK_NOTEBOOK_TAB"))
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_selection_data_set (data,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
target,
|
|
|
|
|
8,
|
|
|
|
|
(void*) &priv->detached_tab->child,
|
|
|
|
|
sizeof (gpointer));
|
2016-03-09 16:43:18 +00:00
|
|
|
|
priv->rootwindow_drop = FALSE;
|
|
|
|
|
}
|
2017-12-14 04:39:03 +00:00
|
|
|
|
else if (target == g_intern_static_string ("application/x-rootwindow-drop"))
|
2016-03-09 16:43:18 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_selection_data_set (data, target, 8, NULL, 0);
|
|
|
|
|
priv->rootwindow_drop = TRUE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_drag_data_received (GtkWidget *widget,
|
2018-05-16 02:50:24 +00:00
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
GtkSelectionData *data)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook;
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkWidget *source_widget;
|
2006-03-22 16:11:48 +00:00
|
|
|
|
GtkWidget **child;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
notebook = GTK_NOTEBOOK (widget);
|
2018-05-16 02:50:24 +00:00
|
|
|
|
drag = gdk_drop_get_drag (drop);
|
|
|
|
|
source_widget = gtk_drag_get_source_widget (drag);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (source_widget &&
|
2018-05-16 02:50:24 +00:00
|
|
|
|
(gdk_drop_get_actions (drop) & GDK_ACTION_MOVE) &&
|
2017-12-14 04:39:03 +00:00
|
|
|
|
gtk_selection_data_get_target (data) == g_intern_static_string ("GTK_NOTEBOOK_TAB"))
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-12-15 23:54:22 +00:00
|
|
|
|
child = (void*) gtk_selection_data_get_data (data);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-12-05 03:06:20 +00:00
|
|
|
|
do_detach_tab (GTK_NOTEBOOK (source_widget), notebook, *child);
|
2018-05-16 02:50:24 +00:00
|
|
|
|
gdk_drop_finish (drop, GDK_ACTION_MOVE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
2006-03-22 16:11:48 +00:00
|
|
|
|
else
|
2018-05-16 02:50:24 +00:00
|
|
|
|
gdk_drop_finish (drop, 0);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Private GtkContainer Methods :
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* gtk_notebook_add
|
|
|
|
|
* gtk_notebook_remove
|
|
|
|
|
* gtk_notebook_focus
|
|
|
|
|
* gtk_notebook_set_focus_child
|
|
|
|
|
* gtk_notebook_child_type
|
|
|
|
|
* gtk_notebook_forall
|
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_add (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_insert_page_menu (GTK_NOTEBOOK (container), widget,
|
|
|
|
|
NULL, NULL, -1);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_remove (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2012-02-10 14:46:57 +00:00
|
|
|
|
GList *children, *list;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gint page_num = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (page->child == widget)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
break;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
page_num++;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
children = children->next;
|
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2006-04-12 04:13:06 +00:00
|
|
|
|
if (children == NULL)
|
|
|
|
|
return;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2006-03-22 21:11:40 +00:00
|
|
|
|
g_object_ref (widget);
|
|
|
|
|
|
2012-02-10 14:46:57 +00:00
|
|
|
|
list = children->next;
|
2006-03-22 21:11:40 +00:00
|
|
|
|
gtk_notebook_real_remove (notebook, children);
|
|
|
|
|
|
2012-02-10 14:46:57 +00:00
|
|
|
|
while (list)
|
|
|
|
|
{
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (list->data), "position");
|
2012-02-10 14:46:57 +00:00
|
|
|
|
list = list->next;
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
g_signal_emit (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[PAGE_REMOVED],
|
|
|
|
|
0,
|
|
|
|
|
widget,
|
|
|
|
|
page_num);
|
|
|
|
|
|
2006-03-22 21:11:40 +00:00
|
|
|
|
g_object_unref (widget);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
focus_tabs_in (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (priv->show_tabs && gtk_notebook_has_current_page (notebook))
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (notebook));
|
2012-06-23 17:07:47 +00:00
|
|
|
|
gtk_notebook_set_focus_child (GTK_CONTAINER (notebook), NULL);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
g_list_find (priv->children,
|
|
|
|
|
priv->cur_page));
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
focus_tabs_move (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction,
|
|
|
|
|
gint search_direction)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GList *new_page;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
new_page = gtk_notebook_search_page (notebook, priv->focus_tab,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
search_direction, TRUE);
|
2006-11-16 12:56:30 +00:00
|
|
|
|
if (!new_page)
|
|
|
|
|
{
|
2013-06-26 19:33:10 +00:00
|
|
|
|
new_page = gtk_notebook_search_page (notebook, NULL,
|
|
|
|
|
search_direction, TRUE);
|
2006-11-16 12:56:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
if (new_page)
|
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, new_page);
|
|
|
|
|
else
|
2006-11-16 12:56:30 +00:00
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (notebook));
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2009-11-09 02:25:05 +00:00
|
|
|
|
focus_child_in (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
if (priv->cur_page)
|
|
|
|
|
return gtk_widget_child_focus (priv->cur_page->child, direction);
|
2002-02-03 01:25:32 +00:00
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-11-09 02:25:05 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
focus_action_in (GtkNotebook *notebook,
|
|
|
|
|
gint action,
|
|
|
|
|
GtkDirectionType direction)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
|
|
|
|
if (priv->action_widget[action] &&
|
2010-03-01 06:47:38 +00:00
|
|
|
|
gtk_widget_get_visible (priv->action_widget[action]))
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return gtk_widget_child_focus (priv->action_widget[action], direction);
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/* Focus in the notebook can either be on the pages, or on
|
2009-11-09 02:25:05 +00:00
|
|
|
|
* the tabs or on the action_widgets.
|
2000-12-11 17:47:24 +00:00
|
|
|
|
*/
|
2013-09-26 23:12:58 +00:00
|
|
|
|
static gboolean
|
2001-06-08 18:09:34 +00:00
|
|
|
|
gtk_notebook_focus (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkDirectionType direction)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkWidget *old_focus_child;
|
|
|
|
|
GtkDirectionType effective_direction;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
gint first_action;
|
|
|
|
|
gint last_action;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
gboolean widget_is_focus;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->tab_pos == GTK_POS_TOP ||
|
|
|
|
|
priv->tab_pos == GTK_POS_LEFT)
|
2009-11-09 02:25:05 +00:00
|
|
|
|
{
|
|
|
|
|
first_action = ACTION_WIDGET_START;
|
|
|
|
|
last_action = ACTION_WIDGET_END;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
first_action = ACTION_WIDGET_END;
|
|
|
|
|
last_action = ACTION_WIDGET_START;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->focus_out)
|
2002-02-08 01:10:25 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->focus_out = FALSE; /* Clear this to catch the wrap-around case */
|
2002-02-08 01:10:25 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-08 18:09:34 +00:00
|
|
|
|
widget_is_focus = gtk_widget_is_focus (widget);
|
2017-02-08 08:00:29 +00:00
|
|
|
|
old_focus_child = gtk_widget_get_focus_child (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2002-02-08 01:10:25 +00:00
|
|
|
|
effective_direction = get_effective_direction (notebook, direction);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (old_focus_child) /* Focus on page child or action widget */
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2001-06-08 18:09:34 +00:00
|
|
|
|
if (gtk_widget_child_focus (old_focus_child, direction))
|
|
|
|
|
return TRUE;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
|
|
|
|
if (old_focus_child == priv->action_widget[ACTION_WIDGET_START])
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) effective_direction)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_DIR_DOWN:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_RIGHT:
|
|
|
|
|
return focus_tabs_in (notebook);
|
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
|
return FALSE;
|
|
|
|
|
case GTK_DIR_UP:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
default:
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) direction)
|
2009-11-09 02:25:05 +00:00
|
|
|
|
{
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if ((priv->tab_pos == GTK_POS_RIGHT || priv->tab_pos == GTK_POS_BOTTOM) &&
|
2009-11-09 02:25:05 +00:00
|
|
|
|
focus_child_in (notebook, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return focus_tabs_in (notebook);
|
2009-11-09 02:25:05 +00:00
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
|
|
|
|
return FALSE;
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2017-10-06 19:19:42 +00:00
|
|
|
|
break;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-11-09 02:25:05 +00:00
|
|
|
|
else if (old_focus_child == priv->action_widget[ACTION_WIDGET_END])
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) effective_direction)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_DIR_DOWN:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_RIGHT:
|
|
|
|
|
return FALSE;
|
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
|
return focus_tabs_in (notebook);
|
|
|
|
|
case GTK_DIR_UP:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
default:
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) direction)
|
2009-11-09 02:25:05 +00:00
|
|
|
|
{
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if ((priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_LEFT) &&
|
2009-11-09 02:25:05 +00:00
|
|
|
|
focus_child_in (notebook, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return focus_tabs_in (notebook);
|
2009-11-09 02:25:05 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2017-10-06 19:19:42 +00:00
|
|
|
|
break;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-11-09 02:25:05 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) effective_direction)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
|
|
|
|
case GTK_DIR_UP:
|
|
|
|
|
/* Focus onto the tabs */
|
|
|
|
|
return focus_tabs_in (notebook);
|
|
|
|
|
case GTK_DIR_DOWN:
|
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
|
case GTK_DIR_RIGHT:
|
|
|
|
|
return FALSE;
|
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return focus_action_in (notebook, last_action, direction);
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
else if (widget_is_focus) /* Focus was on tabs */
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) effective_direction)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2009-11-09 02:25:05 +00:00
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
|
|
|
|
return focus_action_in (notebook, first_action, direction);
|
|
|
|
|
case GTK_DIR_UP:
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return FALSE;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
|
|
|
|
if (focus_child_in (notebook, GTK_DIR_TAB_FORWARD))
|
|
|
|
|
return TRUE;
|
|
|
|
|
return focus_action_in (notebook, last_action, direction);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_DOWN:
|
|
|
|
|
/* We use TAB_FORWARD rather than direction so that we focus a more
|
|
|
|
|
* predictable widget for the user; users may be using arrow focusing
|
|
|
|
|
* in this situation even if they don't usually use arrow focusing.
|
|
|
|
|
*/
|
2009-11-09 02:25:05 +00:00
|
|
|
|
return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
|
return focus_tabs_move (notebook, direction, STEP_PREV);
|
|
|
|
|
case GTK_DIR_RIGHT:
|
|
|
|
|
return focus_tabs_move (notebook, direction, STEP_NEXT);
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
2000-12-11 17:47:24 +00:00
|
|
|
|
else /* Focus was not on widget */
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2017-10-06 19:19:42 +00:00
|
|
|
|
switch ((guint) effective_direction)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
|
|
|
|
case GTK_DIR_DOWN:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (focus_action_in (notebook, first_action, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (focus_tabs_in (notebook))
|
|
|
|
|
return TRUE;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (focus_action_in (notebook, last_action, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (focus_child_in (notebook, direction))
|
|
|
|
|
return TRUE;
|
|
|
|
|
return FALSE;
|
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (focus_action_in (notebook, last_action, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (focus_child_in (notebook, direction))
|
|
|
|
|
return TRUE;
|
|
|
|
|
if (focus_tabs_in (notebook))
|
|
|
|
|
return TRUE;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
if (focus_action_in (notebook, first_action, direction))
|
|
|
|
|
return TRUE;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
case GTK_DIR_UP:
|
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
|
case GTK_DIR_RIGHT:
|
|
|
|
|
return focus_child_in (notebook, direction);
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
g_assert_not_reached ();
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return FALSE;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
}
|
2002-02-09 22:12:04 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_set_focus_child (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2002-01-15 17:40:44 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2002-01-15 17:40:44 +00:00
|
|
|
|
GtkWidget *page_child;
|
|
|
|
|
GtkWidget *toplevel;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2002-01-15 17:40:44 +00:00
|
|
|
|
/* If the old focus widget was within a page of the notebook,
|
|
|
|
|
* (child may either be NULL or not in this case), record it
|
|
|
|
|
* for future use if we switch to the page with a mnemonic.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (container));
|
2010-01-04 06:49:26 +00:00
|
|
|
|
if (toplevel && gtk_widget_is_toplevel (toplevel))
|
2002-01-15 17:40:44 +00:00
|
|
|
|
{
|
2010-08-17 13:13:45 +00:00
|
|
|
|
page_child = gtk_window_get_focus (GTK_WINDOW (toplevel));
|
2002-01-15 17:40:44 +00:00
|
|
|
|
while (page_child)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2010-09-08 06:03:14 +00:00
|
|
|
|
if (gtk_widget_get_parent (page_child) == GTK_WIDGET (container))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2015-09-09 00:55:32 +00:00
|
|
|
|
GList *list = gtk_notebook_find_child (notebook, page_child);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (list != NULL)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = list->data;
|
|
|
|
|
|
|
|
|
|
if (page->last_focus_child)
|
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child);
|
|
|
|
|
|
|
|
|
|
page->last_focus_child = gtk_window_get_focus (GTK_WINDOW (toplevel));
|
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-01-15 17:40:44 +00:00
|
|
|
|
|
2010-09-08 06:03:14 +00:00
|
|
|
|
page_child = gtk_widget_get_parent (page_child);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2002-01-15 17:40:44 +00:00
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (child)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->child_has_focus = TRUE;
|
|
|
|
|
if (!priv->focus_tab)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
GList *children;
|
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
|
|
|
|
children = priv->children;
|
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
if (page->child == child || page->tab_label == child)
|
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, children);
|
|
|
|
|
children = children->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2009-08-06 14:25:20 +00:00
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->child_has_focus = FALSE;
|
2002-01-15 17:40:44 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
GTK_CONTAINER_CLASS (gtk_notebook_parent_class)->set_focus_child (container, child);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_forall (GtkContainer *container,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkCallback callback,
|
|
|
|
|
gpointer callback_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GList *children;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (children)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
|
|
|
|
(* callback) (page->child, callback_data);
|
2016-01-17 20:35:14 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2002-10-05 23:15:39 +00:00
|
|
|
|
static GType
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_child_type (GtkContainer *container)
|
|
|
|
|
{
|
|
|
|
|
return GTK_TYPE_WIDGET;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
/* Private GtkNotebook Methods:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_real_insert_page
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2015-12-19 04:47:48 +00:00
|
|
|
|
page_visible_cb (GtkWidget *child,
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GParamSpec *arg,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2015-12-19 04:47:48 +00:00
|
|
|
|
GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child));
|
|
|
|
|
GtkNotebookPage *page = list->data;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GList *next = NULL;
|
|
|
|
|
|
2015-12-19 04:47:48 +00:00
|
|
|
|
if (priv->menu && page->menu_label)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *parent = gtk_widget_get_parent (page->menu_label);
|
|
|
|
|
if (parent)
|
|
|
|
|
gtk_widget_set_visible (parent, gtk_widget_get_visible (child));
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_visible (page->tab_widget, gtk_widget_get_visible (child));
|
|
|
|
|
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (priv->cur_page == page)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (!gtk_widget_get_visible (child))
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2015-12-23 03:09:30 +00:00
|
|
|
|
list = g_list_find (priv->children, priv->cur_page);
|
|
|
|
|
if (list)
|
|
|
|
|
{
|
|
|
|
|
next = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
|
|
|
|
|
if (!next)
|
|
|
|
|
next = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (next)
|
2019-02-19 23:28:53 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE_FROM_LIST (next));
|
2015-12-23 03:09:30 +00:00
|
|
|
|
}
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_visible (priv->header_widget, priv->show_tabs && gtk_notebook_has_current_page (notebook));
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (!gtk_notebook_has_current_page (notebook) && gtk_widget_get_visible (child))
|
2015-12-19 05:56:04 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_switch_page (notebook, page);
|
|
|
|
|
/* focus_tab is set in the switch_page method */
|
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, priv->focus_tab);
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
static void
|
2017-05-11 06:50:49 +00:00
|
|
|
|
measure_tab (GtkGizmo *gizmo,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum,
|
|
|
|
|
gint *natural,
|
|
|
|
|
gint *minimum_baseline,
|
|
|
|
|
gint *natural_baseline)
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkNotebook *notebook = g_object_get_data (G_OBJECT (gizmo), "notebook");
|
2017-05-11 06:50:49 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GList *l;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkNotebookPage *page = NULL;
|
2017-05-11 06:50:49 +00:00
|
|
|
|
|
|
|
|
|
for (l = priv->children; l; l = l->next)
|
|
|
|
|
{
|
2019-02-19 23:28:53 +00:00
|
|
|
|
GtkNotebookPage *p = GTK_NOTEBOOK_PAGE_FROM_LIST (l);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
if (p->tab_widget == GTK_WIDGET (gizmo))
|
2017-05-11 06:50:49 +00:00
|
|
|
|
{
|
|
|
|
|
page = p;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_assert (page != NULL);
|
2015-12-25 01:39:43 +00:00
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_widget_measure (page->tab_label,
|
|
|
|
|
orientation,
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural,
|
|
|
|
|
minimum_baseline, natural_baseline);
|
2015-12-25 01:39:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
allocate_tab (GtkGizmo *gizmo,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2015-12-25 01:39:43 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkNotebook *notebook = g_object_get_data (G_OBJECT (gizmo), "notebook");
|
2015-12-25 01:39:43 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2017-05-11 06:50:49 +00:00
|
|
|
|
GList *l;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkNotebookPage *page = NULL;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
GtkAllocation child_allocation;
|
|
|
|
|
|
2017-05-11 06:50:49 +00:00
|
|
|
|
for (l = priv->children; l; l = l->next)
|
|
|
|
|
{
|
2019-02-19 23:28:53 +00:00
|
|
|
|
GtkNotebookPage *p = GTK_NOTEBOOK_PAGE_FROM_LIST (l);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
if (p->tab_widget == GTK_WIDGET (gizmo))
|
2017-05-11 06:50:49 +00:00
|
|
|
|
{
|
|
|
|
|
page = p;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_assert (page != NULL);
|
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
child_allocation = (GtkAllocation) {0, 0, width, height};
|
2015-12-25 01:39:43 +00:00
|
|
|
|
|
|
|
|
|
if (!page->fill)
|
|
|
|
|
{
|
|
|
|
|
if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_widget_measure (page->tab_label, GTK_ORIENTATION_HORIZONTAL, height,
|
2017-02-18 10:12:24 +00:00
|
|
|
|
NULL, &child_allocation.width, NULL, NULL);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
if (child_allocation.width > width)
|
|
|
|
|
child_allocation.width = width;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
else
|
2018-08-16 04:53:03 +00:00
|
|
|
|
child_allocation.x += (width - child_allocation.width) / 2;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_widget_measure (page->tab_label, GTK_ORIENTATION_VERTICAL, width,
|
2017-02-18 10:12:24 +00:00
|
|
|
|
NULL, &child_allocation.height, NULL, NULL);
|
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
if (child_allocation.height > height)
|
|
|
|
|
child_allocation.height = height;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
else
|
2018-08-16 04:53:03 +00:00
|
|
|
|
child_allocation.y += (height - child_allocation.height) / 2;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (page->tab_label, &child_allocation, baseline);
|
2015-12-25 01:39:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
static gint
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
|
|
|
|
|
GtkNotebookPage *page,
|
|
|
|
|
int position)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gint nchildren;
|
2012-02-10 14:46:57 +00:00
|
|
|
|
GList *list;
|
2017-06-27 09:44:22 +00:00
|
|
|
|
GtkWidget *sibling;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
nchildren = g_list_length (priv->children);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
if ((position < 0) || (position > nchildren))
|
|
|
|
|
position = nchildren;
|
|
|
|
|
|
2019-02-21 04:02:39 +00:00
|
|
|
|
priv->children = g_list_insert (priv->children, g_object_ref (page), position);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2017-06-27 09:44:22 +00:00
|
|
|
|
if (position < nchildren)
|
2019-02-19 23:28:53 +00:00
|
|
|
|
sibling = GTK_NOTEBOOK_PAGE_FROM_LIST (g_list_nth (priv->children, position))->tab_widget;
|
2017-06-27 09:44:22 +00:00
|
|
|
|
else if (priv->arrow_widget[ARROW_LEFT_AFTER])
|
|
|
|
|
sibling = priv->arrow_widget[ARROW_LEFT_AFTER];
|
|
|
|
|
else
|
|
|
|
|
sibling = priv->arrow_widget[ARROW_RIGHT_AFTER];
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
page->tab_widget = gtk_gizmo_new ("tab", measure_tab, allocate_tab, NULL);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (page->tab_widget), "notebook", notebook);
|
2017-06-27 09:44:22 +00:00
|
|
|
|
gtk_widget_insert_before (page->tab_widget, priv->tabs_widget, sibling);
|
2017-05-11 06:09:14 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
page->expand = FALSE;
|
|
|
|
|
page->fill = TRUE;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu)
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_notebook_menu_item_create (notebook, page);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->stack_widget), page->child);
|
2011-06-26 18:41:21 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
if (page->tab_label)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_widget_set_parent (page->tab_label, page->tab_widget);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (page->tab_label), "notebook", notebook);
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
gtk_notebook_update_labels (notebook);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->first_tab)
|
|
|
|
|
priv->first_tab = priv->children;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
if (page->tab_label)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
if (priv->show_tabs && gtk_widget_get_visible (page->child))
|
|
|
|
|
gtk_widget_show (page->tab_label);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
else
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_widget_hide (page->tab_label);
|
2006-03-29 15:20:21 +00:00
|
|
|
|
|
|
|
|
|
page->mnemonic_activate_signal =
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_signal_connect (page->tab_label,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"mnemonic-activate",
|
|
|
|
|
G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page),
|
|
|
|
|
notebook);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
page->notify_visible_handler = g_signal_connect (page->child, "notify::visible",
|
2011-01-04 07:21:38 +00:00
|
|
|
|
G_CALLBACK (page_visible_cb), notebook);
|
2006-03-29 15:20:21 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_signal_emit (notebook, notebook_signals[PAGE_ADDED], 0, page->child, position);
|
2006-03-29 15:20:21 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (!gtk_notebook_has_current_page (notebook))
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2007-06-03 04:27:56 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, page);
|
2007-05-18 09:42:52 +00:00
|
|
|
|
/* focus_tab is set in the switch_page method */
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, priv->focus_tab);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (page), "tab-expand");
|
|
|
|
|
g_object_notify (G_OBJECT (page), "tab-fill");
|
|
|
|
|
g_object_notify (G_OBJECT (page), "tab-label");
|
|
|
|
|
g_object_notify (G_OBJECT (page), "menu-label");
|
2012-02-10 14:46:57 +00:00
|
|
|
|
|
|
|
|
|
list = g_list_nth (priv->children, position);
|
|
|
|
|
while (list)
|
|
|
|
|
{
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (list->data), "position");
|
2012-02-10 14:46:57 +00:00
|
|
|
|
list = list->next;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
update_arrow_state (notebook);
|
|
|
|
|
|
2019-02-21 02:46:20 +00:00
|
|
|
|
if (priv->pages)
|
|
|
|
|
g_list_model_items_changed (priv->pages, position, 0, 1);
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
/* The page-added handler might have reordered the pages, re-get the position */
|
2019-02-20 13:39:21 +00:00
|
|
|
|
return gtk_notebook_page_num (notebook, page->child);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
gtk_notebook_real_insert_page (GtkNotebook *notebook,
|
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
GtkWidget *menu_label,
|
|
|
|
|
gint position)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page;
|
2019-02-21 04:02:39 +00:00
|
|
|
|
int ret;
|
2019-02-20 13:39:21 +00:00
|
|
|
|
|
|
|
|
|
page = g_object_new (GTK_TYPE_NOTEBOOK_PAGE,
|
|
|
|
|
"child", child,
|
|
|
|
|
"tab", tab_label,
|
|
|
|
|
"menu", menu_label,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2019-02-21 04:02:39 +00:00
|
|
|
|
ret = gtk_notebook_insert_notebook_page (notebook, page, position);
|
|
|
|
|
|
|
|
|
|
g_object_unref (page);
|
|
|
|
|
|
|
|
|
|
return ret;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-11-06 22:05:02 +00:00
|
|
|
|
|
2006-12-22 19:10:43 +00:00
|
|
|
|
static gboolean
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_timer (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
1998-12-15 07:32:11 +00:00
|
|
|
|
gboolean retval = FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->timer)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_notebook_do_arrow (notebook, priv->click_child);
|
2002-03-07 15:39:31 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->need_timer)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
priv->need_timer = FALSE;
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
|
|
|
|
|
(GSourceFunc) gtk_notebook_timer,
|
|
|
|
|
notebook);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer, "[gtk] gtk_notebook_timer");
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
1998-12-15 07:32:11 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
retval = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
1998-12-15 07:32:11 +00:00
|
|
|
|
|
|
|
|
|
return retval;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->timer)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer = g_timeout_add (TIMEOUT_INITIAL,
|
|
|
|
|
(GSourceFunc) gtk_notebook_timer,
|
|
|
|
|
notebook);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer, "[gtk] gtk_notebook_timer");
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->need_timer = TRUE;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static gint
|
|
|
|
|
gtk_notebook_page_compare (gconstpointer a,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gconstpointer b)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
return (((GtkNotebookPage *) a)->child != b);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-31 21:23:19 +00:00
|
|
|
|
static GList*
|
|
|
|
|
gtk_notebook_find_child (GtkNotebook *notebook,
|
2015-09-09 00:55:32 +00:00
|
|
|
|
GtkWidget *child)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2015-09-09 00:55:32 +00:00
|
|
|
|
return g_list_find_custom (notebook->priv->children,
|
|
|
|
|
child,
|
|
|
|
|
gtk_notebook_page_compare);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-09-26 20:33:23 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_remove_tab_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page)
|
2001-09-26 20:33:23 +00:00
|
|
|
|
{
|
|
|
|
|
if (page->tab_label)
|
|
|
|
|
{
|
|
|
|
|
if (page->mnemonic_activate_signal)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
g_signal_handler_disconnect (page->tab_label,
|
|
|
|
|
page->mnemonic_activate_signal);
|
2001-11-30 23:17:29 +00:00
|
|
|
|
page->mnemonic_activate_signal = 0;
|
2001-09-26 20:33:23 +00:00
|
|
|
|
|
2018-03-20 14:21:12 +00:00
|
|
|
|
if (gtk_widget_get_surface (page->tab_label) != gtk_widget_get_surface (GTK_WIDGET (notebook)) ||
|
2012-06-23 13:59:10 +00:00
|
|
|
|
!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *parent;
|
|
|
|
|
|
2012-07-31 18:17:54 +00:00
|
|
|
|
/* we hit this condition during dnd of a detached tab */
|
2012-06-23 13:59:10 +00:00
|
|
|
|
parent = gtk_widget_get_parent (page->tab_label);
|
|
|
|
|
if (GTK_IS_WINDOW (parent))
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (parent), page->tab_label);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_unparent (page->tab_label);
|
|
|
|
|
}
|
2012-07-31 18:17:54 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_unparent (page->tab_label);
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-21 00:12:48 +00:00
|
|
|
|
page->tab_label = NULL;
|
2001-09-26 20:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_real_remove (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *list)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
GList * next_list;
|
|
|
|
|
gint need_resize = FALSE;
|
2007-12-04 18:43:47 +00:00
|
|
|
|
GtkWidget *tab_label;
|
2006-03-21 00:12:48 +00:00
|
|
|
|
gboolean destroying;
|
2019-02-21 02:46:20 +00:00
|
|
|
|
int position;
|
2006-03-21 00:12:48 +00:00
|
|
|
|
|
2010-09-28 16:24:34 +00:00
|
|
|
|
destroying = gtk_widget_in_destruction (GTK_WIDGET (notebook));
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2008-06-08 21:41:16 +00:00
|
|
|
|
next_list = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (!next_list)
|
2008-06-08 21:41:16 +00:00
|
|
|
|
next_list = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->children = g_list_remove_link (priv->children, list);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page == list->data)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->cur_page = NULL;
|
2002-12-10 12:02:43 +00:00
|
|
|
|
if (next_list && !destroying)
|
2019-02-19 23:28:53 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE_FROM_LIST (next_list));
|
2015-01-30 14:26:04 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER && !priv->remove_in_detach)
|
2015-01-30 04:48:06 +00:00
|
|
|
|
gtk_notebook_stop_reorder (notebook);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
if (priv->detached_tab == list->data)
|
2015-01-30 04:51:26 +00:00
|
|
|
|
{
|
|
|
|
|
priv->detached_tab = NULL;
|
|
|
|
|
|
2015-01-30 14:26:04 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_DETACH && !priv->remove_in_detach)
|
2015-01-30 04:51:26 +00:00
|
|
|
|
{
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag;
|
2015-01-30 04:51:26 +00:00
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
|
drag = (GdkDrag *)g_object_get_data (G_OBJECT (priv->dnd_child), "drag-context");
|
|
|
|
|
gtk_drag_cancel (drag);
|
2015-01-30 04:51:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-09-20 00:56:26 +00:00
|
|
|
|
if (priv->switch_tab == list)
|
|
|
|
|
priv->switch_tab = NULL;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (list == priv->first_tab)
|
|
|
|
|
priv->first_tab = next_list;
|
|
|
|
|
if (list == priv->focus_tab && !destroying)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (notebook, next_list);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
page = list->data;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2019-02-21 02:46:20 +00:00
|
|
|
|
position = g_list_index (priv->children, page);
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
g_signal_handler_disconnect (page->child, page->notify_visible_handler);
|
2006-02-20 23:11:55 +00:00
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
|
if (gtk_widget_get_visible (page->child) &&
|
|
|
|
|
gtk_widget_get_visible (GTK_WIDGET (notebook)))
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
need_resize = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->stack_widget), page->child);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2007-12-04 18:43:47 +00:00
|
|
|
|
tab_label = page->tab_label;
|
2012-01-15 23:54:05 +00:00
|
|
|
|
if (tab_label)
|
2007-12-10 06:19:53 +00:00
|
|
|
|
{
|
|
|
|
|
g_object_ref (tab_label);
|
|
|
|
|
gtk_notebook_remove_tab_label (notebook, page);
|
|
|
|
|
if (destroying)
|
|
|
|
|
gtk_widget_destroy (tab_label);
|
|
|
|
|
g_object_unref (tab_label);
|
2010-03-22 18:11:05 +00:00
|
|
|
|
}
|
2007-12-10 06:19:53 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-09-08 06:03:14 +00:00
|
|
|
|
GtkWidget *parent = gtk_widget_get_parent (page->menu_label);
|
2010-03-22 18:11:05 +00:00
|
|
|
|
|
|
|
|
|
gtk_notebook_menu_label_unparent (parent, NULL);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->menu), parent);
|
2010-03-22 18:11:05 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2010-03-22 18:11:05 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_list_free (list);
|
2002-04-12 21:52:16 +00:00
|
|
|
|
|
|
|
|
|
if (page->last_focus_child)
|
|
|
|
|
{
|
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child);
|
|
|
|
|
page->last_focus_child = NULL;
|
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_unparent (page->tab_widget);
|
2015-09-06 23:44:53 +00:00
|
|
|
|
|
2019-02-19 23:44:40 +00:00
|
|
|
|
g_object_unref (page);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_update_labels (notebook);
|
|
|
|
|
if (need_resize)
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
2019-02-21 02:46:20 +00:00
|
|
|
|
|
|
|
|
|
if (priv->pages)
|
|
|
|
|
g_list_model_items_changed (priv->pages, position, 1, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_update_labels (GtkNotebook *notebook)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkNotebookPage *page;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
2019-02-20 13:39:21 +00:00
|
|
|
|
char string[32];
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gint page_num = 1;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->show_tabs && !priv->menu)
|
2007-11-26 18:21:13 +00:00
|
|
|
|
return;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
for (list = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, FALSE);
|
|
|
|
|
list;
|
|
|
|
|
list = gtk_notebook_search_page (notebook, list, STEP_NEXT, FALSE))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
const char *text;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
page = list->data;
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_snprintf (string, sizeof (string), _("Page %u"), page_num++);
|
|
|
|
|
if (page->tab_text)
|
|
|
|
|
text = page->tab_text;
|
|
|
|
|
else
|
|
|
|
|
text = string;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->show_tabs)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (page->default_tab)
|
|
|
|
|
{
|
|
|
|
|
if (!page->tab_label)
|
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
page->tab_label = gtk_label_new ("");
|
|
|
|
|
g_object_ref_sink (page->tab_label);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (page->tab_label), "notebook", notebook);
|
|
|
|
|
gtk_widget_set_parent (page->tab_label, page->tab_widget);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_label_set_text (GTK_LABEL (page->tab_label), text);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
if (page->child && page->tab_label)
|
|
|
|
|
gtk_widget_set_visible (page->tab_label, gtk_widget_get_visible (page->child));
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2019-02-20 13:39:21 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu && page->default_menu)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2019-02-20 13:39:21 +00:00
|
|
|
|
if (page->menu_text)
|
|
|
|
|
text = page->menu_text;
|
|
|
|
|
else if (GTK_IS_LABEL (page->tab_label))
|
|
|
|
|
text = gtk_label_get_text (GTK_LABEL (page->tab_label));
|
2011-01-04 07:21:38 +00:00
|
|
|
|
else
|
2019-02-20 13:39:21 +00:00
|
|
|
|
text = string;
|
|
|
|
|
gtk_label_set_text (GTK_LABEL (page->menu_label), text);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2010-12-13 12:39:53 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
|
gtk_notebook_search_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *list,
|
|
|
|
|
gint direction,
|
|
|
|
|
gboolean find_visible)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page = NULL;
|
|
|
|
|
GList *old_list = NULL;
|
|
|
|
|
|
|
|
|
|
if (list)
|
|
|
|
|
page = list->data;
|
|
|
|
|
|
2011-01-04 06:39:18 +00:00
|
|
|
|
if (!page || direction == STEP_NEXT)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (list)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
old_list = list;
|
|
|
|
|
list = list->next;
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
list = priv->children;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (list)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
page = list->data;
|
|
|
|
|
if (direction == STEP_NEXT &&
|
|
|
|
|
(!find_visible ||
|
|
|
|
|
(gtk_widget_get_visible (page->child) &&
|
|
|
|
|
(!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
|
|
|
|
|
return list;
|
|
|
|
|
old_list = list;
|
|
|
|
|
list = list->next;
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
list = old_list;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
list = list->prev;
|
|
|
|
|
}
|
|
|
|
|
while (list)
|
|
|
|
|
{
|
|
|
|
|
page = list->data;
|
2011-01-04 06:39:18 +00:00
|
|
|
|
if (direction == STEP_PREV &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
(!find_visible ||
|
|
|
|
|
(gtk_widget_get_visible (page->child) &&
|
|
|
|
|
(!page->tab_label || NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page)))))
|
|
|
|
|
return list;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
list = list->prev;
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-18 07:01:40 +00:00
|
|
|
|
static void
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gtk_notebook_snapshot_tabs (GtkGizmo *gizmo,
|
|
|
|
|
GtkSnapshot *snapshot)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkWidget *widget = gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (gizmo)));
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (gtk_widget_get_parent (widget));
|
2015-12-19 21:25:34 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2011-04-06 04:18:18 +00:00
|
|
|
|
GList *children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gboolean showarrow;
|
2015-12-17 04:27:51 +00:00
|
|
|
|
gint step = STEP_PREV;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
gboolean is_rtl;
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos;
|
2015-12-25 22:44:08 +00:00
|
|
|
|
guint i;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
|
|
|
|
tab_pos = get_effective_tab_pos (notebook);
|
2011-01-04 07:03:03 +00:00
|
|
|
|
showarrow = FALSE;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (!gtk_notebook_has_current_page (notebook))
|
2019-01-18 07:01:40 +00:00
|
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->first_tab)
|
|
|
|
|
priv->first_tab = priv->children;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, priv->cur_page) ||
|
|
|
|
|
!gtk_widget_get_mapped (priv->cur_page->tab_label))
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2015-12-17 04:27:51 +00:00
|
|
|
|
step = STEP_PREV;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
step = is_rtl ? STEP_PREV : STEP_NEXT;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
step = STEP_PREV;
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-12-13 12:39:53 +00:00
|
|
|
|
for (children = priv->children; children; children = children->next)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
if (!gtk_widget_get_visible (page->child) ||
|
|
|
|
|
page == priv->detached_tab)
|
2010-12-13 12:39:53 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_mapped (page->tab_label))
|
|
|
|
|
showarrow = TRUE;
|
|
|
|
|
|
|
|
|
|
/* No point in keeping searching */
|
2011-01-04 07:03:03 +00:00
|
|
|
|
if (showarrow)
|
2010-12-13 12:39:53 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
for (children = gtk_notebook_search_page (notebook, NULL, step, TRUE);
|
|
|
|
|
children;
|
|
|
|
|
children = gtk_notebook_search_page (notebook, children, step, TRUE))
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
2011-03-05 08:01:44 +00:00
|
|
|
|
|
|
|
|
|
if (page == priv->cur_page)
|
|
|
|
|
break;
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
if (!gtk_notebook_page_tab_label_is_visible (page))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
continue;
|
2010-05-04 18:16:34 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), page->tab_widget, snapshot);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-03-05 08:01:44 +00:00
|
|
|
|
if (children != NULL)
|
|
|
|
|
{
|
2011-04-06 04:18:18 +00:00
|
|
|
|
GList *other_order = NULL;
|
2011-03-05 08:01:44 +00:00
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
for (children = gtk_notebook_search_page (notebook, children, step, TRUE);
|
|
|
|
|
children;
|
|
|
|
|
children = gtk_notebook_search_page (notebook, children, step, TRUE))
|
2011-03-05 08:01:44 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
2015-12-25 01:39:43 +00:00
|
|
|
|
|
|
|
|
|
if (!gtk_notebook_page_tab_label_is_visible (page))
|
2011-03-05 08:01:44 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
other_order = g_list_prepend (other_order, page);
|
2011-03-05 08:01:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* draw them with the opposite order */
|
2011-04-06 04:18:18 +00:00
|
|
|
|
for (children = other_order; children; children = children->next)
|
2011-03-05 08:01:44 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), page->tab_widget, snapshot);
|
2011-03-05 08:01:44 +00:00
|
|
|
|
}
|
2011-04-06 04:18:18 +00:00
|
|
|
|
|
|
|
|
|
g_list_free (other_order);
|
2011-03-05 08:01:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (showarrow && priv->scrollable)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2015-12-25 22:44:08 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[i] == NULL)
|
2015-12-25 22:44:08 +00:00
|
|
|
|
continue;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->arrow_widget[i], snapshot);
|
2015-12-25 22:44:08 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
2010-09-06 23:33:25 +00:00
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
if (priv->operation != DRAG_OPERATION_DETACH)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_snapshot_child (GTK_WIDGET (gizmo), priv->cur_page->tab_widget, snapshot);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
/* Private GtkNotebook Size Allocate Functions:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_calculate_shown_tabs
|
|
|
|
|
* gtk_notebook_calculate_tabs_allocation
|
|
|
|
|
* gtk_notebook_calc_tabs
|
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
2016-01-06 16:41:41 +00:00
|
|
|
|
gtk_notebook_allocate_arrows (GtkNotebook *notebook,
|
|
|
|
|
GtkAllocation *allocation)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2018-03-31 19:02:28 +00:00
|
|
|
|
GtkAllocation arrow_allocation;
|
2016-01-06 16:41:41 +00:00
|
|
|
|
gint size1, size2, min, nat;
|
|
|
|
|
guint i, ii;
|
2006-05-10 14:02:20 +00:00
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
switch (priv->tab_pos)
|
2010-09-07 00:28:26 +00:00
|
|
|
|
{
|
2016-01-06 16:41:41 +00:00
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
arrow_allocation.y = allocation->y;
|
|
|
|
|
arrow_allocation.height = allocation->height;
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
ii = i < 2 ? i : i ^ 1;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[ii] == NULL)
|
2016-01-06 16:41:41 +00:00
|
|
|
|
continue;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
|
2017-05-11 05:48:46 +00:00
|
|
|
|
gtk_widget_measure (priv->arrow_widget[ii],
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
|
allocation->height,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
if (i < 2)
|
|
|
|
|
{
|
|
|
|
|
arrow_allocation.x = allocation->x;
|
|
|
|
|
arrow_allocation.width = min;
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[ii],
|
|
|
|
|
&arrow_allocation,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
-1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
allocation->x += min;
|
|
|
|
|
allocation->width -= min;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
arrow_allocation.x = allocation->x + allocation->width - min;
|
|
|
|
|
arrow_allocation.width = min;
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[ii],
|
|
|
|
|
&arrow_allocation,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
-1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
allocation->width -= min;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2010-12-13 12:39:53 +00:00
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[0] || priv->arrow_widget[1])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_START,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
allocation->width,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_notebook_distribute_arrow_width (notebook, GTK_PACK_START, allocation->width, &size1, &size2);
|
|
|
|
|
arrow_allocation.x = allocation->x;
|
|
|
|
|
arrow_allocation.y = allocation->y;
|
|
|
|
|
arrow_allocation.width = size1;
|
|
|
|
|
arrow_allocation.height = min;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[0])
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[0], &arrow_allocation, -1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
arrow_allocation.x += size1;
|
|
|
|
|
arrow_allocation.width = size2;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[1])
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[1], &arrow_allocation, -1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
allocation->y += min;
|
|
|
|
|
allocation->height -= min;
|
|
|
|
|
}
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2] || priv->arrow_widget[3])
|
2016-01-06 16:41:41 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_notebook_measure_arrows (notebook,
|
|
|
|
|
GTK_PACK_END,
|
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
allocation->width,
|
|
|
|
|
&min, &nat,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
gtk_notebook_distribute_arrow_width (notebook, GTK_PACK_END, allocation->width, &size1, &size2);
|
|
|
|
|
arrow_allocation.x = allocation->x;
|
|
|
|
|
arrow_allocation.y = allocation->y + allocation->height - min;
|
|
|
|
|
arrow_allocation.width = size1;
|
|
|
|
|
arrow_allocation.height = min;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[2])
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[2], &arrow_allocation, -1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
arrow_allocation.x += size1;
|
|
|
|
|
arrow_allocation.width = size2;
|
2017-05-11 05:48:46 +00:00
|
|
|
|
if (priv->arrow_widget[3])
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->arrow_widget[3], &arrow_allocation, -1);
|
2016-01-06 16:41:41 +00:00
|
|
|
|
allocation->height -= min;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2016-01-06 16:41:41 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_tab_space (GtkNotebook *notebook,
|
|
|
|
|
int notebook_width,
|
|
|
|
|
int notebook_height,
|
|
|
|
|
gboolean *show_arrows,
|
|
|
|
|
GtkAllocation *tabs_allocation,
|
|
|
|
|
gint *tab_space)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GList *children;
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
|
2006-01-12 21:31:55 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
*tabs_allocation = (GtkAllocation) {0, 0, notebook_width, notebook_height};
|
2015-12-29 18:31:04 +00:00
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
case GTK_POS_TOP:
|
2006-05-09 02:36:08 +00:00
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
while (children)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2006-07-02 15:12:40 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
|
|
|
|
|
gtk_widget_get_visible (page->child))
|
|
|
|
|
*tab_space += page->requisition.width;
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
case GTK_POS_LEFT:
|
2006-05-09 02:36:08 +00:00
|
|
|
|
while (children)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2006-07-02 15:12:40 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
|
|
|
|
|
gtk_widget_get_visible (page->child))
|
|
|
|
|
*tab_space += page->requisition.height;
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->scrollable)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
*show_arrows = FALSE;
|
|
|
|
|
else
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
2015-12-29 18:31:04 +00:00
|
|
|
|
if (*tab_space > tabs_allocation->width)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
*show_arrows = TRUE;
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
gtk_notebook_allocate_arrows (notebook, tabs_allocation);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
*tab_space = tabs_allocation->width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
2015-12-29 18:31:04 +00:00
|
|
|
|
if (*tab_space > tabs_allocation->height)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
*show_arrows = TRUE;
|
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
gtk_notebook_allocate_arrows (notebook, tabs_allocation);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2016-01-06 16:41:41 +00:00
|
|
|
|
*tab_space = tabs_allocation->height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2015-12-29 18:31:04 +00:00
|
|
|
|
gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
|
|
|
|
|
gboolean show_arrows,
|
|
|
|
|
const GtkAllocation *tabs_allocation,
|
|
|
|
|
gint tab_space,
|
|
|
|
|
GList **last_child,
|
|
|
|
|
gint *n,
|
|
|
|
|
gint *remaining_space)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GList *children;
|
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
|
|
|
|
if (show_arrows) /* first_tab <- focus_tab */
|
|
|
|
|
{
|
|
|
|
|
*remaining_space = tab_space;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, priv->cur_page) &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_widget_get_visible (priv->cur_page->child))
|
|
|
|
|
{
|
|
|
|
|
gtk_notebook_calc_tabs (notebook,
|
|
|
|
|
priv->focus_tab,
|
|
|
|
|
&(priv->focus_tab),
|
|
|
|
|
remaining_space, STEP_NEXT);
|
|
|
|
|
}
|
2006-06-05 01:38:49 +00:00
|
|
|
|
|
2010-01-18 19:04:49 +00:00
|
|
|
|
if (tab_space <= 0 || *remaining_space <= 0)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
/* show 1 tab */
|
|
|
|
|
priv->first_tab = priv->focus_tab;
|
|
|
|
|
*last_child = gtk_notebook_search_page (notebook, priv->focus_tab,
|
|
|
|
|
STEP_NEXT, TRUE);
|
2009-05-18 03:43:26 +00:00
|
|
|
|
*n = 1;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
children = NULL;
|
|
|
|
|
|
|
|
|
|
if (priv->first_tab && priv->first_tab != priv->focus_tab)
|
|
|
|
|
{
|
|
|
|
|
/* Is first_tab really predecessor of focus_tab? */
|
|
|
|
|
page = priv->first_tab->data;
|
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
|
|
|
|
|
gtk_widget_get_visible (page->child))
|
|
|
|
|
for (children = priv->focus_tab;
|
|
|
|
|
children && children != priv->first_tab;
|
|
|
|
|
children = gtk_notebook_search_page (notebook,
|
|
|
|
|
children,
|
|
|
|
|
STEP_PREV,
|
|
|
|
|
TRUE));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!children)
|
|
|
|
|
{
|
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, priv->cur_page))
|
|
|
|
|
priv->first_tab = priv->focus_tab;
|
|
|
|
|
else
|
|
|
|
|
priv->first_tab = gtk_notebook_search_page (notebook, priv->focus_tab,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
STEP_NEXT, TRUE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
/* calculate shown tabs counting backwards from the focus tab */
|
|
|
|
|
gtk_notebook_calc_tabs (notebook,
|
|
|
|
|
gtk_notebook_search_page (notebook,
|
|
|
|
|
priv->focus_tab,
|
|
|
|
|
STEP_PREV,
|
|
|
|
|
TRUE),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
&(priv->first_tab),
|
|
|
|
|
remaining_space,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
STEP_PREV);
|
|
|
|
|
|
|
|
|
|
if (*remaining_space < 0)
|
|
|
|
|
{
|
|
|
|
|
priv->first_tab =
|
|
|
|
|
gtk_notebook_search_page (notebook, priv->first_tab,
|
|
|
|
|
STEP_NEXT, TRUE);
|
|
|
|
|
if (!priv->first_tab)
|
|
|
|
|
priv->first_tab = priv->focus_tab;
|
|
|
|
|
|
|
|
|
|
*last_child = gtk_notebook_search_page (notebook, priv->focus_tab,
|
|
|
|
|
STEP_NEXT, TRUE);
|
|
|
|
|
}
|
|
|
|
|
else /* focus_tab -> end */
|
|
|
|
|
{
|
|
|
|
|
if (!priv->first_tab)
|
|
|
|
|
priv->first_tab = gtk_notebook_search_page (notebook,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
NULL,
|
|
|
|
|
STEP_NEXT,
|
|
|
|
|
TRUE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
children = NULL;
|
|
|
|
|
gtk_notebook_calc_tabs (notebook,
|
|
|
|
|
gtk_notebook_search_page (notebook,
|
|
|
|
|
priv->focus_tab,
|
|
|
|
|
STEP_NEXT,
|
|
|
|
|
TRUE),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
&children,
|
|
|
|
|
remaining_space,
|
|
|
|
|
STEP_NEXT);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
|
|
|
|
if (*remaining_space <= 0)
|
|
|
|
|
*last_child = children;
|
|
|
|
|
else /* start <- first_tab */
|
|
|
|
|
{
|
|
|
|
|
*last_child = NULL;
|
|
|
|
|
children = NULL;
|
|
|
|
|
|
|
|
|
|
gtk_notebook_calc_tabs (notebook,
|
|
|
|
|
gtk_notebook_search_page (notebook,
|
|
|
|
|
priv->first_tab,
|
|
|
|
|
STEP_PREV,
|
|
|
|
|
TRUE),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
&children,
|
|
|
|
|
remaining_space,
|
|
|
|
|
STEP_PREV);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
|
|
|
|
if (*remaining_space == 0)
|
|
|
|
|
priv->first_tab = children;
|
|
|
|
|
else
|
|
|
|
|
priv->first_tab = gtk_notebook_search_page(notebook,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
children,
|
|
|
|
|
STEP_NEXT,
|
|
|
|
|
TRUE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2009-05-18 03:43:26 +00:00
|
|
|
|
if (*remaining_space < 0)
|
|
|
|
|
{
|
|
|
|
|
/* calculate number of tabs */
|
|
|
|
|
*remaining_space = - (*remaining_space);
|
|
|
|
|
*n = 0;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
for (children = priv->first_tab;
|
2009-05-18 03:43:26 +00:00
|
|
|
|
children && children != *last_child;
|
|
|
|
|
children = gtk_notebook_search_page (notebook, children,
|
|
|
|
|
STEP_NEXT, TRUE))
|
|
|
|
|
(*n)++;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2009-05-18 03:43:26 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*remaining_space = 0;
|
2009-05-18 03:43:26 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
|
|
|
|
/* unmap all non-visible tabs */
|
|
|
|
|
for (children = gtk_notebook_search_page (notebook, NULL,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
STEP_NEXT, TRUE);
|
|
|
|
|
children && children != priv->first_tab;
|
|
|
|
|
children = gtk_notebook_search_page (notebook, children,
|
|
|
|
|
STEP_NEXT, TRUE))
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
|
|
|
|
|
if (page->tab_label &&
|
|
|
|
|
NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_child_visible (page->tab_widget, FALSE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
|
|
|
|
for (children = *last_child; children;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
children = gtk_notebook_search_page (notebook, children,
|
|
|
|
|
STEP_NEXT, TRUE))
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (page->tab_label &&
|
|
|
|
|
NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_child_visible (page->tab_widget, FALSE);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
else /* !show_arrows */
|
1998-06-10 21:48:21 +00:00
|
|
|
|
{
|
2010-10-11 19:23:03 +00:00
|
|
|
|
GtkOrientation tab_expand_orientation;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gint c = 0;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
*n = 0;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
|
2010-10-11 19:23:03 +00:00
|
|
|
|
if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
|
2015-12-29 18:31:04 +00:00
|
|
|
|
{
|
|
|
|
|
tab_expand_orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
*remaining_space = tabs_allocation->width - tab_space;
|
|
|
|
|
}
|
2010-10-11 19:23:03 +00:00
|
|
|
|
else
|
2015-12-29 18:31:04 +00:00
|
|
|
|
{
|
|
|
|
|
tab_expand_orientation = GTK_ORIENTATION_VERTICAL;
|
|
|
|
|
*remaining_space = tabs_allocation->height - tab_space;
|
|
|
|
|
}
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
|
|
|
|
priv->first_tab = gtk_notebook_search_page (notebook, NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
STEP_NEXT, TRUE);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
while (children)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
|
|
|
|
|
!gtk_widget_get_visible (page->child))
|
|
|
|
|
continue;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
c++;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (page->expand ||
|
2010-10-11 19:23:03 +00:00
|
|
|
|
(gtk_widget_compute_expand (page->tab_label, tab_expand_orientation)))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
(*n)++;
|
|
|
|
|
}
|
1998-06-10 21:48:21 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
get_allocate_at_bottom (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint search_direction)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
|
|
|
|
gboolean is_rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos = get_effective_tab_pos (GTK_NOTEBOOK (widget));
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
|
|
|
|
switch (tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
if (!is_rtl)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return (search_direction == STEP_PREV);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return (search_direction == STEP_NEXT);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
return (search_direction == STEP_PREV);
|
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-09-17 16:02:26 +00:00
|
|
|
|
static void
|
2015-12-29 18:31:04 +00:00
|
|
|
|
gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook,
|
|
|
|
|
GList **children,
|
|
|
|
|
GList *last_child,
|
|
|
|
|
gboolean showarrow,
|
|
|
|
|
gint direction,
|
|
|
|
|
gint *remaining_space,
|
|
|
|
|
gint *expanded_tabs,
|
|
|
|
|
const GtkAllocation *allocation)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
gboolean allocate_at_bottom;
|
2015-12-17 01:39:24 +00:00
|
|
|
|
gint tab_extra_space;
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gint left_x, right_x, top_y, bottom_y, anchor;
|
|
|
|
|
gboolean gap_left, packing_changed;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
GtkAllocation child_allocation;
|
2010-10-11 19:23:03 +00:00
|
|
|
|
GtkOrientation tab_expand_orientation;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
graphene_rect_t drag_bounds;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2015-03-10 08:34:39 +00:00
|
|
|
|
g_assert (priv->cur_page != NULL);
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
widget = GTK_WIDGET (notebook);
|
|
|
|
|
tab_pos = get_effective_tab_pos (notebook);
|
|
|
|
|
allocate_at_bottom = get_allocate_at_bottom (widget, direction);
|
|
|
|
|
|
2015-12-29 18:31:04 +00:00
|
|
|
|
child_allocation = *allocation;
|
2003-12-08 21:07:17 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
switch (tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
case GTK_POS_TOP:
|
2015-12-29 18:31:04 +00:00
|
|
|
|
if (allocate_at_bottom)
|
|
|
|
|
child_allocation.x += allocation->width;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
anchor = child_allocation.x;
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
case GTK_POS_LEFT:
|
2015-12-29 18:31:04 +00:00
|
|
|
|
if (allocate_at_bottom)
|
|
|
|
|
child_allocation.y += allocation->height;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
anchor = child_allocation.y;
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
anchor = 0;
|
|
|
|
|
break;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->cur_page->tab_widget, priv->cur_page->tab_widget, &drag_bounds))
|
|
|
|
|
graphene_rect_init_from_rect (&drag_bounds, graphene_rect_zero ());
|
2018-04-07 08:02:02 +00:00
|
|
|
|
|
2006-06-15 18:46:03 +00:00
|
|
|
|
left_x = CLAMP (priv->mouse_x - priv->drag_offset_x,
|
2018-04-07 08:02:02 +00:00
|
|
|
|
allocation->x, allocation->x + allocation->width - drag_bounds.size.width);
|
2006-06-15 18:46:03 +00:00
|
|
|
|
top_y = CLAMP (priv->mouse_y - priv->drag_offset_y,
|
2018-04-07 08:02:02 +00:00
|
|
|
|
allocation->y, allocation->y + allocation->height - drag_bounds.size.height);
|
|
|
|
|
right_x = left_x + drag_bounds.size.width;
|
|
|
|
|
bottom_y = top_y + drag_bounds.size.height;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gap_left = packing_changed = FALSE;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-10-11 19:23:03 +00:00
|
|
|
|
if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
|
|
|
|
|
tab_expand_orientation = GTK_ORIENTATION_HORIZONTAL;
|
|
|
|
|
else
|
|
|
|
|
tab_expand_orientation = GTK_ORIENTATION_VERTICAL;
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
while (*children && *children != last_child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2006-05-09 02:36:08 +00:00
|
|
|
|
page = (*children)->data;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
if (direction == STEP_NEXT)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*children = gtk_notebook_search_page (notebook, *children, direction, TRUE);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
*children = (*children)->next;
|
2011-03-03 23:26:09 +00:00
|
|
|
|
continue;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
|
|
|
|
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
continue;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-05-13 03:16:09 +00:00
|
|
|
|
tab_extra_space = 0;
|
2011-07-19 10:53:06 +00:00
|
|
|
|
if (*expanded_tabs && (showarrow || page->expand || gtk_widget_compute_expand (page->tab_label, tab_expand_orientation)))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
tab_extra_space = *remaining_space / *expanded_tabs;
|
|
|
|
|
*remaining_space -= tab_extra_space;
|
|
|
|
|
(*expanded_tabs)--;
|
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
2015-12-17 01:39:24 +00:00
|
|
|
|
child_allocation.width = MAX (1, page->requisition.width + tab_extra_space);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
|
|
|
|
/* make sure that the reordered tab doesn't go past the last position */
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER &&
|
|
|
|
|
!gap_left && packing_changed)
|
|
|
|
|
{
|
|
|
|
|
if (!allocate_at_bottom)
|
|
|
|
|
{
|
|
|
|
|
if (left_x >= anchor)
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
left_x = priv->drag_surface_x = anchor;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (right_x <= anchor)
|
|
|
|
|
{
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.width;
|
2018-03-20 11:05:26 +00:00
|
|
|
|
left_x = priv->drag_surface_x = anchor;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gap_left = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER && page == priv->cur_page)
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
priv->drag_surface_x = left_x;
|
|
|
|
|
priv->drag_surface_y = child_allocation.y;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (allocate_at_bottom)
|
|
|
|
|
anchor -= child_allocation.width;
|
|
|
|
|
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
|
|
|
|
{
|
|
|
|
|
if (!allocate_at_bottom &&
|
|
|
|
|
left_x >= anchor &&
|
|
|
|
|
left_x <= anchor + child_allocation.width / 2)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
else if (allocate_at_bottom &&
|
|
|
|
|
right_x >= anchor + child_allocation.width / 2 &&
|
|
|
|
|
right_x <= anchor + child_allocation.width)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
child_allocation.x = anchor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
2015-12-17 01:39:24 +00:00
|
|
|
|
child_allocation.height = MAX (1, page->requisition.height + tab_extra_space);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
|
|
|
|
/* make sure that the reordered tab doesn't go past the last position */
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER &&
|
|
|
|
|
!gap_left && packing_changed)
|
|
|
|
|
{
|
|
|
|
|
if (!allocate_at_bottom && top_y >= anchor)
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
top_y = priv->drag_surface_y = anchor;
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gap_left = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER && page == priv->cur_page)
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
priv->drag_surface_x = child_allocation.x;
|
|
|
|
|
priv->drag_surface_y = top_y;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (allocate_at_bottom)
|
|
|
|
|
anchor -= child_allocation.height;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
|
2011-01-04 06:57:22 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (!allocate_at_bottom &&
|
|
|
|
|
top_y >= anchor &&
|
|
|
|
|
top_y <= anchor + child_allocation.height / 2)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
else if (allocate_at_bottom &&
|
|
|
|
|
bottom_y >= anchor + child_allocation.height / 2 &&
|
|
|
|
|
bottom_y <= anchor + child_allocation.height)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
child_allocation.y = anchor;
|
|
|
|
|
}
|
2017-10-06 19:19:42 +00:00
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2011-01-04 07:21:38 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2017-07-22 12:13:03 +00:00
|
|
|
|
/* set child visible */
|
|
|
|
|
if (page->tab_label)
|
|
|
|
|
gtk_widget_set_child_visible (page->tab_widget, TRUE);
|
|
|
|
|
|
2015-12-25 01:39:43 +00:00
|
|
|
|
if (page == priv->cur_page && priv->operation == DRAG_OPERATION_REORDER)
|
|
|
|
|
{
|
2018-03-20 11:05:26 +00:00
|
|
|
|
GtkAllocation fixed_allocation = { priv->drag_surface_x, priv->drag_surface_y,
|
2016-01-07 11:28:24 +00:00
|
|
|
|
child_allocation.width, child_allocation.height };
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (page->tab_widget, &fixed_allocation, -1);
|
2015-12-25 01:39:43 +00:00
|
|
|
|
}
|
|
|
|
|
else if (page == priv->detached_tab && priv->operation == DRAG_OPERATION_DETACH)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
/* needs to be allocated at 0,0
|
|
|
|
|
* to be shown in the drag window */
|
2016-01-07 11:28:24 +00:00
|
|
|
|
GtkAllocation fixed_allocation = { 0, 0, child_allocation.width, child_allocation.height };
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (page->tab_widget, &fixed_allocation, -1);
|
2016-01-07 11:28:24 +00:00
|
|
|
|
}
|
2017-07-05 14:04:59 +00:00
|
|
|
|
else if (gtk_notebook_page_tab_label_is_visible (page))
|
2016-01-07 11:28:24 +00:00
|
|
|
|
{
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (page->tab_widget, &child_allocation, -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
/* calculate whether to leave a gap based on reorder operation or not */
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
2017-09-11 08:26:52 +00:00
|
|
|
|
if (priv->operation != DRAG_OPERATION_REORDER || page != priv->cur_page)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
|
|
|
|
{
|
2011-01-04 06:57:22 +00:00
|
|
|
|
if (!allocate_at_bottom &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
left_x > anchor + child_allocation.width / 2 &&
|
|
|
|
|
left_x <= anchor + child_allocation.width)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.width;
|
2011-01-04 06:57:22 +00:00
|
|
|
|
else if (allocate_at_bottom &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
right_x >= anchor &&
|
|
|
|
|
right_x <= anchor + child_allocation.width / 2)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!allocate_at_bottom)
|
2015-12-17 01:39:24 +00:00
|
|
|
|
anchor += child_allocation.width;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
2017-09-11 08:26:52 +00:00
|
|
|
|
if (priv->operation != DRAG_OPERATION_REORDER || page != priv->cur_page)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER)
|
|
|
|
|
{
|
|
|
|
|
if (!allocate_at_bottom &&
|
|
|
|
|
top_y >= anchor + child_allocation.height / 2 &&
|
|
|
|
|
top_y <= anchor + child_allocation.height)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor += drag_bounds.size.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
else if (allocate_at_bottom &&
|
|
|
|
|
bottom_y >= anchor &&
|
|
|
|
|
bottom_y <= anchor + child_allocation.height / 2)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!allocate_at_bottom)
|
2015-12-17 01:39:24 +00:00
|
|
|
|
anchor += child_allocation.height;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
/* Don't move the current tab past the last position during tabs reordering */
|
2017-08-01 18:45:57 +00:00
|
|
|
|
if (priv->operation == DRAG_OPERATION_REORDER &&
|
2011-01-04 06:57:22 +00:00
|
|
|
|
direction == STEP_NEXT)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
if (allocate_at_bottom)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.width;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if ((!allocate_at_bottom && priv->drag_surface_x > anchor) ||
|
|
|
|
|
(allocate_at_bottom && priv->drag_surface_x < anchor))
|
|
|
|
|
priv->drag_surface_x = anchor;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
if (allocate_at_bottom)
|
2018-04-07 08:02:02 +00:00
|
|
|
|
anchor -= drag_bounds.size.height;
|
2006-03-28 18:58:05 +00:00
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
if ((!allocate_at_bottom && priv->drag_surface_y > anchor) ||
|
|
|
|
|
(allocate_at_bottom && priv->drag_surface_y < anchor))
|
|
|
|
|
priv->drag_surface_y = anchor;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
2006-05-09 02:36:08 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_pages_allocate (GtkNotebook *notebook,
|
|
|
|
|
int width,
|
|
|
|
|
int height)
|
2006-05-09 02:36:08 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2006-05-09 02:36:08 +00:00
|
|
|
|
GList *children = NULL;
|
|
|
|
|
GList *last_child = NULL;
|
|
|
|
|
gboolean showarrow = FALSE;
|
2015-12-29 18:31:04 +00:00
|
|
|
|
GtkAllocation tabs_allocation;
|
|
|
|
|
gint tab_space, remaining_space;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gint expanded_tabs;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2015-12-23 00:18:30 +00:00
|
|
|
|
if (!priv->show_tabs || !gtk_notebook_has_current_page (notebook))
|
2006-05-09 02:36:08 +00:00
|
|
|
|
return;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2015-12-29 18:31:04 +00:00
|
|
|
|
tab_space = remaining_space = 0;
|
2006-05-13 03:16:09 +00:00
|
|
|
|
expanded_tabs = 1;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_notebook_tab_space (notebook, width, height,
|
2015-12-29 18:31:04 +00:00
|
|
|
|
&showarrow, &tabs_allocation, &tab_space);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gtk_notebook_calculate_shown_tabs (notebook, showarrow,
|
2015-12-29 18:31:04 +00:00
|
|
|
|
&tabs_allocation, tab_space, &last_child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
&expanded_tabs, &remaining_space);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->first_tab;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
gtk_notebook_calculate_tabs_allocation (notebook, &children, last_child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
showarrow, STEP_NEXT,
|
2015-12-29 18:31:04 +00:00
|
|
|
|
&remaining_space, &expanded_tabs, &tabs_allocation);
|
2006-05-09 02:36:08 +00:00
|
|
|
|
if (children && children != last_child)
|
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
2006-06-15 18:46:03 +00:00
|
|
|
|
gtk_notebook_calculate_tabs_allocation (notebook, &children, last_child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
showarrow, STEP_PREV,
|
2015-12-29 18:31:04 +00:00
|
|
|
|
&remaining_space, &expanded_tabs, &tabs_allocation);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->first_tab)
|
|
|
|
|
priv->first_tab = priv->children;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
static void
|
2006-05-09 02:36:08 +00:00
|
|
|
|
gtk_notebook_calc_tabs (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GList *start,
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList **end,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint *tab_space,
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
guint direction)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = NULL;
|
|
|
|
|
GList *children;
|
2006-06-05 01:38:49 +00:00
|
|
|
|
GList *last_calculated_child = NULL;
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
if (!start)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
return;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
children = start;
|
|
|
|
|
|
2011-03-03 23:26:09 +00:00
|
|
|
|
switch (tab_pos)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
while (children)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
page = children->data;
|
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
|
|
|
|
|
gtk_widget_get_visible (page->child))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*tab_space -= page->requisition.width;
|
|
|
|
|
if (*tab_space < 0 || children == *end)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (*tab_space < 0)
|
2011-01-04 06:57:22 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*tab_space = - (*tab_space +
|
|
|
|
|
page->requisition.width);
|
2011-01-04 06:57:22 +00:00
|
|
|
|
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (*tab_space == 0 && direction == STEP_PREV)
|
|
|
|
|
children = last_calculated_child;
|
2011-01-04 06:57:22 +00:00
|
|
|
|
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*end = children;
|
2011-01-04 06:57:22 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
return;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
|
|
|
|
|
last_calculated_child = children;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (direction == STEP_NEXT)
|
|
|
|
|
children = children->next;
|
|
|
|
|
else
|
|
|
|
|
children = children->prev;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
while (children)
|
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
if (NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) &&
|
|
|
|
|
gtk_widget_get_visible (page->child))
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*tab_space -= page->requisition.height;
|
|
|
|
|
if (*tab_space < 0 || children == *end)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (*tab_space < 0)
|
2011-01-04 06:57:22 +00:00
|
|
|
|
{
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*tab_space = - (*tab_space + page->requisition.height);
|
2011-01-04 06:57:22 +00:00
|
|
|
|
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (*tab_space == 0 && direction == STEP_PREV)
|
|
|
|
|
children = last_calculated_child;
|
2011-01-04 06:57:22 +00:00
|
|
|
|
|
2011-03-03 23:26:09 +00:00
|
|
|
|
*end = children;
|
2011-01-04 06:57:22 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
return;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
|
|
|
|
|
last_calculated_child = children;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
if (direction == STEP_NEXT)
|
|
|
|
|
children = children->next;
|
|
|
|
|
else
|
|
|
|
|
children = children->prev;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2011-03-03 23:26:09 +00:00
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Private GtkNotebook Page Switch Methods:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_real_switch_page
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_real_switch_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget* child,
|
|
|
|
|
guint page_num)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2015-09-09 00:55:32 +00:00
|
|
|
|
GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child));
|
2019-02-19 23:28:53 +00:00
|
|
|
|
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE_FROM_LIST (list);
|
2009-08-06 14:25:20 +00:00
|
|
|
|
gboolean child_has_focus;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page == page || !gtk_widget_get_visible (GTK_WIDGET (child)))
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2009-08-06 14:25:20 +00:00
|
|
|
|
/* save the value here, changing visibility changes focus */
|
2010-07-13 15:47:05 +00:00
|
|
|
|
child_has_focus = priv->child_has_focus;
|
2009-08-06 14:25:20 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_unset_state_flags (priv->cur_page->tab_widget, GTK_STATE_FLAG_CHECKED);
|
2006-12-26 10:31:36 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->cur_page = page;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_state_flags (page->tab_widget, GTK_STATE_FLAG_CHECKED, FALSE);
|
|
|
|
|
gtk_widget_set_visible (priv->header_widget, priv->show_tabs);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->focus_tab ||
|
|
|
|
|
priv->focus_tab->data != (gpointer) priv->cur_page)
|
|
|
|
|
priv->focus_tab =
|
|
|
|
|
g_list_find (priv->children, priv->cur_page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_stack_set_visible_child (GTK_STACK (priv->stack_widget), priv->cur_page->child);
|
|
|
|
|
gtk_widget_set_child_visible (priv->cur_page->tab_widget, TRUE);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
|
2002-01-15 17:40:44 +00:00
|
|
|
|
/* If the focus was on the previous page, move it to the first
|
|
|
|
|
* element on the new page, if possible, or if not, to the
|
|
|
|
|
* notebook itself.
|
|
|
|
|
*/
|
2009-08-06 14:25:20 +00:00
|
|
|
|
if (child_has_focus)
|
2002-01-15 17:40:44 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page->last_focus_child &&
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_widget_is_ancestor (priv->cur_page->last_focus_child, priv->cur_page->child))
|
|
|
|
|
gtk_widget_grab_focus (priv->cur_page->last_focus_child);
|
2002-01-15 17:40:44 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
if (!gtk_widget_child_focus (priv->cur_page->child, GTK_DIR_TAB_FORWARD))
|
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (notebook));
|
2002-01-15 17:40:44 +00:00
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
update_arrow_state (notebook);
|
2016-08-24 18:10:35 +00:00
|
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
2018-01-04 20:38:22 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->tabs_widget);
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_PAGE]);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Private GtkNotebook Page Switch Functions:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_switch_page
|
|
|
|
|
* gtk_notebook_page_select
|
|
|
|
|
* gtk_notebook_switch_focus_tab
|
|
|
|
|
* gtk_notebook_menu_switch_page
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_switch_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2007-06-03 04:27:56 +00:00
|
|
|
|
guint page_num;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page == page)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page_num = g_list_index (priv->children, page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2002-10-05 23:15:39 +00:00
|
|
|
|
g_signal_emit (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[SWITCH_PAGE],
|
|
|
|
|
0,
|
|
|
|
|
page->child,
|
|
|
|
|
page_num);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_page_select (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean move_focus)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
GtkDirectionType dir;
|
2013-11-20 17:32:10 +00:00
|
|
|
|
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->focus_tab)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page = priv->focus_tab->data;
|
2007-06-03 04:27:56 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
if (move_focus)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2003-12-08 21:07:17 +00:00
|
|
|
|
switch (tab_pos)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
|
|
|
|
dir = GTK_DIR_DOWN;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_BOTTOM:
|
|
|
|
|
dir = GTK_DIR_UP;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_LEFT:
|
|
|
|
|
dir = GTK_DIR_RIGHT;
|
|
|
|
|
break;
|
|
|
|
|
case GTK_POS_RIGHT:
|
|
|
|
|
dir = GTK_DIR_LEFT;
|
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
dir = GTK_DIR_DOWN;
|
|
|
|
|
break;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
2001-06-08 18:09:34 +00:00
|
|
|
|
|
|
|
|
|
if (gtk_widget_child_focus (page->child, dir))
|
|
|
|
|
return TRUE;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
|
|
|
|
|
GList *new_child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->focus_tab == new_child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->focus_tab = new_child;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (!priv->show_tabs || !priv->focus_tab)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page = priv->focus_tab->data;
|
2007-06-03 04:27:56 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_menu_switch_page (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebook *notebook;
|
2010-09-08 06:03:14 +00:00
|
|
|
|
GtkWidget *parent;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *children;
|
|
|
|
|
guint page_num;
|
|
|
|
|
|
2010-09-08 06:03:14 +00:00
|
|
|
|
parent = gtk_widget_get_parent (widget);
|
|
|
|
|
notebook = GTK_NOTEBOOK (gtk_menu_get_attach_widget (GTK_MENU (parent)));
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->cur_page == page)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
page_num = 0;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (children && children->data != page)
|
|
|
|
|
{
|
|
|
|
|
children = children->next;
|
|
|
|
|
page_num++;
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-05 23:15:39 +00:00
|
|
|
|
g_signal_emit (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[SWITCH_PAGE],
|
|
|
|
|
0,
|
|
|
|
|
page->child,
|
|
|
|
|
page_num);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Private GtkNotebook Menu Functions:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_menu_item_create
|
2018-10-12 22:12:53 +00:00
|
|
|
|
* gtk_notebook_menu_item_recreate
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_menu_label_unparent
|
|
|
|
|
* gtk_notebook_menu_detacher
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_menu_item_create (GtkNotebook *notebook,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
GtkNotebookPage *page)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkWidget *menu_item;
|
|
|
|
|
|
|
|
|
|
if (page->default_menu)
|
|
|
|
|
{
|
2008-02-06 09:53:34 +00:00
|
|
|
|
if (GTK_IS_LABEL (page->tab_label))
|
2018-03-16 22:11:58 +00:00
|
|
|
|
page->menu_label = gtk_label_new (gtk_label_get_text (GTK_LABEL (page->tab_label)));
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
else
|
2011-01-04 07:21:38 +00:00
|
|
|
|
page->menu_label = gtk_label_new ("");
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_object_ref_sink (page->menu_label);
|
2011-05-20 01:48:22 +00:00
|
|
|
|
gtk_widget_set_halign (page->menu_label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (page->menu_label, GTK_ALIGN_CENTER);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_show (page->menu_label);
|
|
|
|
|
menu_item = gtk_menu_item_new ();
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (menu_item), page->menu_label);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_menu_shell_insert (GTK_MENU_SHELL (priv->menu), menu_item,
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_list_index (priv->children, page));
|
2002-10-05 23:15:39 +00:00
|
|
|
|
g_signal_connect (menu_item, "activate",
|
2011-01-04 07:21:38 +00:00
|
|
|
|
G_CALLBACK (gtk_notebook_menu_switch_page), page);
|
2010-03-01 06:47:38 +00:00
|
|
|
|
if (gtk_widget_get_visible (page->child))
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_widget_show (menu_item);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-12 22:12:53 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_menu_item_recreate (GtkNotebook *notebook,
|
|
|
|
|
GList *list)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GtkNotebookPage *page = list->data;
|
|
|
|
|
GtkWidget *menu_item = gtk_widget_get_parent (page->menu_label);
|
|
|
|
|
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (menu_item), page->menu_label);
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->menu), menu_item);
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_notebook_menu_item_create (notebook, page);
|
2018-10-12 22:12:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
static void
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_menu_label_unparent (GtkWidget *widget,
|
|
|
|
|
gpointer data)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2014-06-16 21:31:56 +00:00
|
|
|
|
gtk_widget_unparent (gtk_bin_get_child (GTK_BIN (widget)));
|
|
|
|
|
_gtk_bin_set_child (GTK_BIN (widget), NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_menu_detacher (GtkWidget *widget,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkMenu *menu)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
g_return_if_fail (priv->menu == (GtkWidget*) menu);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->menu = NULL;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Public GtkNotebook Page Insert/Remove Methods :
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_append_page
|
|
|
|
|
* gtk_notebook_append_page_menu
|
|
|
|
|
* gtk_notebook_prepend_page
|
|
|
|
|
* gtk_notebook_prepend_page_menu
|
|
|
|
|
* gtk_notebook_insert_page
|
|
|
|
|
* gtk_notebook_insert_page_menu
|
|
|
|
|
* gtk_notebook_remove_page
|
|
|
|
|
*/
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_append_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Appends a page to @notebook.
|
2004-01-15 23:04:43 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the appended
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook, or -1 if function fails
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_append_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, -1);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_append_page_menu:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @menu_label: (allow-none): 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.
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Appends a page to @notebook, specifying the widget to use as the
|
|
|
|
|
* label in the popup menu.
|
2004-01-15 23:04:43 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the appended
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook, or -1 if function fails
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_append_page_menu (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
GtkWidget *menu_label)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
|
|
|
|
g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
return gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, -1);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_prepend_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2000-12-11 17:47:24 +00:00
|
|
|
|
*
|
2001-11-14 22:36:23 +00:00
|
|
|
|
* Prepends a page to @notebook.
|
2004-01-15 23:04:43 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the prepended
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook, or -1 if function fails
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_prepend_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, 0);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_prepend_page_menu:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @menu_label: (allow-none): 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.
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Prepends a page to @notebook, specifying the widget to use as the
|
|
|
|
|
* label in the popup menu.
|
2004-01-15 23:04:43 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the prepended
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook, or -1 if function fails
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
GtkWidget *menu_label)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
|
|
|
|
g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
return gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, 0);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_insert_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* @position: the index (starting at 0) at which to insert the page,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* or -1 to append the page after all other pages
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2004-01-15 23:04:43 +00:00
|
|
|
|
* Insert a page into @notebook at the given position.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the inserted
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook, or -1 if function fails
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_insert_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
gint position)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, position);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-21 18:58:28 +00:00
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
gtk_notebook_page_compare_tab (gconstpointer a,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gconstpointer b)
|
2001-03-21 18:58:28 +00:00
|
|
|
|
{
|
|
|
|
|
return (((GtkNotebookPage *) a)->tab_label != b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2001-04-01 07:32:41 +00:00
|
|
|
|
gtk_notebook_mnemonic_activate_switch_page (GtkWidget *child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean overload,
|
|
|
|
|
gpointer data)
|
2001-03-21 18:58:28 +00:00
|
|
|
|
{
|
|
|
|
|
GtkNotebook *notebook = GTK_NOTEBOOK (data);
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2001-03-21 18:58:28 +00:00
|
|
|
|
GList *list;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
list = g_list_find_custom (priv->children, child,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_notebook_page_compare_tab);
|
2001-03-22 13:44:00 +00:00
|
|
|
|
if (list)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPage *page = list->data;
|
2001-03-21 18:58:28 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (notebook)); /* Do this first to avoid focusing new page */
|
2007-06-03 04:27:56 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, page);
|
2002-01-15 17:40:44 +00:00
|
|
|
|
focus_tabs_in (notebook);
|
2001-03-22 13:44:00 +00:00
|
|
|
|
}
|
2001-03-21 18:58:28 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_insert_page_menu:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child: the #GtkWidget to use as the contents of the page
|
|
|
|
|
* @tab_label: (allow-none): the #GtkWidget to be used as the label
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* for the page, or %NULL to use the default label, “page N”
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @menu_label: (allow-none): 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.
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* @position: the index (starting at 0) at which to insert the page,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* or -1 to append the page after all other pages.
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Insert a page into @notebook at the given position, specifying
|
|
|
|
|
* the widget to use as the label in the popup menu.
|
2004-01-15 23:04:43 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the inserted
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook
|
|
|
|
|
*/
|
2004-01-15 23:04:43 +00:00
|
|
|
|
gint
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_insert_page_menu (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label,
|
|
|
|
|
GtkWidget *menu_label,
|
|
|
|
|
gint position)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GtkNotebookClass *class;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2004-01-15 23:04:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
|
|
|
|
|
g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
|
|
|
|
|
g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
class = GTK_NOTEBOOK_GET_CLASS (notebook);
|
2004-01-15 23:04:43 +00:00
|
|
|
|
|
2006-02-23 17:59:33 +00:00
|
|
|
|
return (class->insert_page) (notebook, child, tab_label, menu_label, position);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_remove_page:
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @notebook: a #GtkNotebook
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* @page_num: the index of a notebook page, starting
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* from 0. If -1, the last page will be removed.
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Removes a page from the notebook given its index
|
|
|
|
|
* in the notebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_remove_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint page_num)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (page_num >= 0)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
list = g_list_nth (priv->children, page_num);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
list = g_list_last (priv->children);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
if (list)
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (notebook),
|
2011-01-04 07:21:38 +00:00
|
|
|
|
((GtkNotebookPage *) list->data)->child);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
1998-01-06 21:59:43 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
/* Public GtkNotebook Page Switch Methods :
|
1998-11-28 07:42:37 +00:00
|
|
|
|
* gtk_notebook_get_current_page
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_page_num
|
2001-06-24 15:34:48 +00:00
|
|
|
|
* gtk_notebook_set_current_page
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_next_page
|
|
|
|
|
* gtk_notebook_prev_page
|
|
|
|
|
*/
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_current_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Returns the page number of the current page.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index (starting from 0) of the current
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* page in the notebook. If the notebook has no pages,
|
|
|
|
|
* then -1 will be returned.
|
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gint
|
1998-11-28 07:42:37 +00:00
|
|
|
|
gtk_notebook_get_current_page (GtkNotebook *notebook)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (!priv->cur_page)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return -1;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return g_list_index (priv->children, priv->cur_page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_nth_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2007-05-29 22:13:42 +00:00
|
|
|
|
* @page_num: the index of a page in the notebook, or -1
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* to get the last page
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Returns the child widget contained in page number @page_num.
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the child widget, or %NULL if @page_num
|
|
|
|
|
* is out of bounds
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
1998-12-02 03:40:03 +00:00
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_notebook_get_nth_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint page_num)
|
1998-12-02 00:52:14 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
1998-12-02 00:52:14 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2002-09-23 22:05:41 +00:00
|
|
|
|
GList *list;
|
1998-12-02 00:52:14 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
2002-09-23 22:05:41 +00:00
|
|
|
|
if (page_num >= 0)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
list = g_list_nth (priv->children, page_num);
|
2002-09-23 22:05:41 +00:00
|
|
|
|
else
|
2010-07-13 15:47:05 +00:00
|
|
|
|
list = g_list_last (priv->children);
|
1998-12-02 00:52:14 +00:00
|
|
|
|
|
2002-09-23 22:05:41 +00:00
|
|
|
|
if (list)
|
|
|
|
|
{
|
|
|
|
|
page = list->data;
|
|
|
|
|
return page->child;
|
|
|
|
|
}
|
1998-12-02 00:52:14 +00:00
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-23 22:05:41 +00:00
|
|
|
|
/**
|
2002-10-10 23:42:57 +00:00
|
|
|
|
* gtk_notebook_get_n_pages:
|
2002-09-23 22:05:41 +00:00
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2002-09-23 22:05:41 +00:00
|
|
|
|
* Gets the number of pages in a notebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the number of pages in the notebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2002-09-23 22:05:41 +00:00
|
|
|
|
gint
|
|
|
|
|
gtk_notebook_get_n_pages (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
2002-09-23 22:05:41 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), 0);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
return g_list_length (priv->children);
|
2002-09-23 22:05:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_page_num:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a #GtkWidget
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Finds the index of the page which contains the given child
|
|
|
|
|
* widget.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index of the page containing @child, or
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* -1 if @child is not in the notebook
|
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gint
|
|
|
|
|
gtk_notebook_page_num (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *children;
|
|
|
|
|
gint num;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
num = 0;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (children)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkNotebookPage *page = children->data;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (page->child == child)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
return num;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
1998-02-19 05:13:46 +00:00
|
|
|
|
children = children->next;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
num++;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return -1;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
2001-06-24 15:34:48 +00:00
|
|
|
|
* gtk_notebook_set_current_page:
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @page_num: index of the page to switch to, starting from 0.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* If negative, the last page will be used. If greater
|
|
|
|
|
* than the number of pages in the notebook, nothing
|
|
|
|
|
* will be done.
|
|
|
|
|
*
|
|
|
|
|
* Switches to the page number @page_num.
|
2006-08-16 14:38:02 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that due to historical reasons, GtkNotebook refuses
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* to switch to a page unless the child widget is visible.
|
2006-08-16 14:38:02 +00:00
|
|
|
|
* Therefore, it is recommended to show child widgets before
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* adding them to a notebook.
|
2006-08-16 14:38:02 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_notebook_set_current_page (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gint page_num)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
2007-05-29 22:13:42 +00:00
|
|
|
|
if (page_num < 0)
|
2010-07-13 15:47:05 +00:00
|
|
|
|
page_num = g_list_length (priv->children) - 1;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
list = g_list_nth (priv->children, page_num);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (list)
|
2019-02-19 23:28:53 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE_FROM_LIST (list));
|
2014-06-09 13:15:39 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_PAGE]);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_next_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Switches to the next page. Nothing happens if the current page is
|
|
|
|
|
* the last page.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_next_page (GtkNotebook *notebook)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
list = g_list_find (priv->children, priv->cur_page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (!list)
|
1998-02-25 22:03:10 +00:00
|
|
|
|
return;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
list = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
|
|
|
|
|
if (!list)
|
|
|
|
|
return;
|
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE_FROM_LIST (list));
|
1998-01-06 21:59:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_prev_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Switches to the previous page. Nothing happens if the current page
|
|
|
|
|
* is the first page.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_prev_page (GtkNotebook *notebook)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
list = g_list_find (priv->children, priv->cur_page);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (!list)
|
|
|
|
|
return;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
list = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
|
|
|
|
|
if (!list)
|
|
|
|
|
return;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE_FROM_LIST (list));
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
/* Public GtkNotebook/Tab Style Functions
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_set_show_border
|
2010-08-10 01:20:07 +00:00
|
|
|
|
* gtk_notebook_get_show_border
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_set_show_tabs
|
2010-08-10 01:20:07 +00:00
|
|
|
|
* gtk_notebook_get_show_tabs
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_set_tab_pos
|
2010-08-10 01:20:07 +00:00
|
|
|
|
* gtk_notebook_get_tab_pos
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_set_scrollable
|
2010-08-10 01:20:07 +00:00
|
|
|
|
* gtk_notebook_get_scrollable
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
*/
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_show_border:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @show_border: %TRUE if a bevel should be drawn around the notebook
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Sets whether a bevel will be drawn around the notebook pages.
|
2002-05-02 19:16:06 +00:00
|
|
|
|
* This only has a visual effect when the tabs are not shown.
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* See gtk_notebook_set_show_tabs().
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_show_border (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean show_border)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->show_border != show_border)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->show_border = show_border;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2015-10-31 14:23:40 +00:00
|
|
|
|
if (show_border)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
|
2015-10-31 14:23:40 +00:00
|
|
|
|
else
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_FRAME);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_SHOW_BORDER]);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_show_border:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
*
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* Returns whether a bevel will be drawn around the notebook pages.
|
|
|
|
|
* See gtk_notebook_set_show_border().
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the bevel is drawn
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_notebook_get_show_border (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return notebook->priv->show_border;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_show_tabs:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @show_tabs: %TRUE if the tabs should be shown
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Sets whether to show the tabs for the notebook or not.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_show_tabs (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean show_tabs)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
GList *children;
|
2010-01-18 06:20:50 +00:00
|
|
|
|
gint i;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
2010-01-18 06:20:50 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
show_tabs = show_tabs != FALSE;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->show_tabs == show_tabs)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->show_tabs = show_tabs;
|
|
|
|
|
children = priv->children;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
if (!show_tabs)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-03-02 03:40:38 +00:00
|
|
|
|
gtk_widget_set_can_focus (GTK_WIDGET (notebook), FALSE);
|
2010-01-18 06:20:50 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
while (children)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
page = children->data;
|
|
|
|
|
children = children->next;
|
|
|
|
|
if (page->default_tab)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_destroy (page->tab_label);
|
|
|
|
|
page->tab_label = NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_hide (page->tab_label);
|
|
|
|
|
}
|
2017-11-03 10:22:00 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_hide (priv->header_widget);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
else
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-03-02 03:40:38 +00:00
|
|
|
|
gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_update_labels (notebook);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_show (priv->header_widget);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
2010-01-18 06:20:50 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < N_ACTION_WIDGETS; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->action_widget[i])
|
|
|
|
|
gtk_widget_set_child_visible (priv->action_widget[i], show_tabs);
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-23 03:09:30 +00:00
|
|
|
|
gtk_notebook_update_tab_pos (notebook);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_SHOW_TABS]);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_show_tabs:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
*
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* Returns whether the tabs of the notebook are shown.
|
|
|
|
|
* See gtk_notebook_set_show_tabs().
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the tabs are shown
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_notebook_get_show_tabs (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return notebook->priv->show_tabs;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-09-07 10:08:45 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_update_tab_pos (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
GtkPositionType tab_pos;
|
2015-12-19 21:25:34 +00:00
|
|
|
|
const char *tab_pos_names[] = {
|
|
|
|
|
GTK_STYLE_CLASS_LEFT,
|
|
|
|
|
GTK_STYLE_CLASS_RIGHT,
|
|
|
|
|
GTK_STYLE_CLASS_TOP,
|
|
|
|
|
GTK_STYLE_CLASS_BOTTOM
|
2015-09-07 10:08:45 +00:00
|
|
|
|
};
|
2015-10-31 14:23:40 +00:00
|
|
|
|
gint i;
|
2015-09-07 10:08:45 +00:00
|
|
|
|
|
|
|
|
|
tab_pos = get_effective_tab_pos (notebook);
|
|
|
|
|
|
2015-10-31 14:23:40 +00:00
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (tab_pos_names); i++)
|
2015-09-07 10:08:45 +00:00
|
|
|
|
{
|
2015-10-31 14:23:40 +00:00
|
|
|
|
if (tab_pos == i)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (priv->header_widget),
|
|
|
|
|
tab_pos_names[i]);
|
2015-10-31 14:23:40 +00:00
|
|
|
|
else
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_remove_class (gtk_widget_get_style_context (priv->header_widget),
|
|
|
|
|
tab_pos_names[i]);
|
2015-09-07 10:08:45 +00:00
|
|
|
|
}
|
2015-12-23 03:09:30 +00:00
|
|
|
|
|
|
|
|
|
switch (tab_pos)
|
|
|
|
|
{
|
|
|
|
|
case GTK_POS_TOP:
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->tabs_widget, TRUE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->tabs_widget, FALSE);
|
|
|
|
|
gtk_widget_set_hexpand (priv->header_widget, TRUE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->header_widget, FALSE);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (priv->show_tabs)
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, NULL);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_HORIZONTAL);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_POS_BOTTOM:
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->tabs_widget, TRUE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->tabs_widget, FALSE);
|
|
|
|
|
gtk_widget_set_hexpand (priv->header_widget, TRUE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->header_widget, FALSE);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (priv->show_tabs)
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, gtk_widget_get_last_child (priv->box));
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_HORIZONTAL);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_POS_LEFT:
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->tabs_widget, FALSE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->tabs_widget, TRUE);
|
|
|
|
|
gtk_widget_set_hexpand (priv->header_widget, FALSE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->header_widget, TRUE);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (priv->show_tabs)
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, NULL);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_VERTICAL);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_POS_RIGHT:
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->tabs_widget, FALSE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->tabs_widget, TRUE);
|
|
|
|
|
gtk_widget_set_hexpand (priv->header_widget, FALSE);
|
|
|
|
|
gtk_widget_set_vexpand (priv->header_widget, TRUE);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
if (priv->show_tabs)
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->box), priv->header_widget, gtk_widget_get_last_child (priv->box));
|
2017-05-13 09:38:30 +00:00
|
|
|
|
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_VERTICAL);
|
2015-12-23 03:09:30 +00:00
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
|
|
|
|
break;
|
2015-12-23 03:09:30 +00:00
|
|
|
|
}
|
2015-09-07 10:08:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_tab_pos:
|
Mass fixing of trivial doc bugs. (#63544, #57007, #64141, #63472, #57108,
* gtk/gtkiconfactory.c, gtk/gtktextbuffer.c, gtk/gtktreemodel.c,
gtk/gtkwindow.c, gtk/gtknotebook.c, gtk/gtkradiobutton.c,
gtk/gtktextiter.c, gtk/gtkdialog.c: Mass fixing of trivial doc bugs.
(#63544, #57007, #64141, #63472, #57108, #60818, #61562)
* gtk/tmpl/gtkaccellabel.sgml, gtk/tmpl/gtkcombo.sgml,
gtk/tmpl/gtkentry.sgml, gtk/tmpl/gtkhscrollbar.sgml,
gtk/tmpl/gtkvscrollbar.sgml, gtk/tmpl/gtktoolbar.sgml,
gtk/tmpl/gtkdialog.sgml, gtk/tmpl/gtkstatusbar.sgml:
Mass fixing of trivial doc bugs. (#55579, #56760, #58769, #55918,
#64154, #60422, #54697)
2001-11-10 22:06:44 +00:00
|
|
|
|
* @notebook: a #GtkNotebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @pos: the edge to draw the tabs at
|
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Sets the edge at which the tabs for switching pages in the
|
|
|
|
|
* notebook are drawn.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_tab_pos (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkPositionType pos)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
1998-07-19 19:09:27 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->tab_pos != pos)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->tab_pos = pos;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2015-09-07 10:08:45 +00:00
|
|
|
|
gtk_notebook_update_tab_pos (notebook);
|
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_TAB_POS]);
|
2014-06-09 13:15:39 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_tab_pos:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
*
|
|
|
|
|
* Gets the edge at which the tabs for switching pages in the
|
|
|
|
|
* notebook are drawn.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the edge at which the tabs are drawn
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
GtkPositionType
|
|
|
|
|
gtk_notebook_get_tab_pos (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), GTK_POS_TOP);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return notebook->priv->tab_pos;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_scrollable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @scrollable: %TRUE if scroll arrows should be added
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets whether the tab label area will have arrows for
|
|
|
|
|
* scrolling if there are too many tabs to fit in the area.
|
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_scrollable (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gboolean scrollable)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
scrollable = (scrollable != FALSE);
|
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
if (priv->scrollable == scrollable)
|
|
|
|
|
return;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
priv->scrollable = scrollable;
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
update_arrow_nodes (notebook);
|
|
|
|
|
update_arrow_state (notebook);
|
|
|
|
|
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
2015-11-08 20:01:09 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_SCROLLABLE]);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_scrollable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
*
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* Returns whether the tab label area has arrows for scrolling.
|
|
|
|
|
* See gtk_notebook_set_scrollable().
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if arrows for scrolling are present
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_notebook_get_scrollable (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return notebook->priv->scrollable;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-10 01:20:07 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
/* Public GtkNotebook Popup Menu Methods:
|
|
|
|
|
*
|
|
|
|
|
* gtk_notebook_popup_enable
|
|
|
|
|
* gtk_notebook_popup_disable
|
|
|
|
|
*/
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_popup_enable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
|
|
|
|
* Enables the popup menu: if the user clicks with the right
|
|
|
|
|
* mouse button on the tab labels, a menu with all the pages
|
|
|
|
|
* will be popped up.
|
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_popup_enable (GtkNotebook *notebook)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->menu)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->menu = gtk_menu_new ();
|
2013-08-18 14:45:24 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (priv->menu),
|
|
|
|
|
GTK_STYLE_CLASS_CONTEXT_MENU);
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
for (list = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, FALSE);
|
|
|
|
|
list;
|
|
|
|
|
list = gtk_notebook_search_page (notebook, list, STEP_NEXT, FALSE))
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_notebook_menu_item_create (notebook, list->data);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
gtk_notebook_update_labels (notebook);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_menu_attach_to_widget (GTK_MENU (priv->menu),
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GTK_WIDGET (notebook),
|
|
|
|
|
gtk_notebook_menu_detacher);
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_ENABLE_POPUP]);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_popup_disable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Disables the popup menu.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2014-06-09 13:15:39 +00:00
|
|
|
|
gtk_notebook_popup_disable (GtkNotebook *notebook)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
1998-02-19 05:13:46 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
if (!priv->menu)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_container_foreach (GTK_CONTAINER (priv->menu),
|
2011-01-04 07:21:38 +00:00
|
|
|
|
(GtkCallback) gtk_notebook_menu_label_unparent, NULL);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_widget_destroy (priv->menu);
|
2001-05-17 16:22:06 +00:00
|
|
|
|
|
2015-09-07 22:53:06 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_ENABLE_POPUP]);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
/* Public GtkNotebook Page Properties Functions:
|
|
|
|
|
*
|
1998-11-28 07:42:37 +00:00
|
|
|
|
* gtk_notebook_get_tab_label
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_set_tab_label
|
|
|
|
|
* gtk_notebook_set_tab_label_text
|
1998-11-28 07:42:37 +00:00
|
|
|
|
* gtk_notebook_get_menu_label
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
* gtk_notebook_set_menu_label
|
|
|
|
|
* gtk_notebook_set_menu_label_text
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* gtk_notebook_get_tab_reorderable
|
|
|
|
|
* gtk_notebook_set_tab_reorderable
|
|
|
|
|
* gtk_notebook_get_tab_detachable
|
|
|
|
|
* gtk_notebook_set_tab_detachable
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
*/
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_tab_label:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the page
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
|
|
|
|
* 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.
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2017-04-29 11:08:26 +00:00
|
|
|
|
* Returns: (transfer none) (nullable): the tab label
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkWidget *
|
1998-11-28 07:42:37 +00:00
|
|
|
|
gtk_notebook_get_tab_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
2001-07-31 21:23:19 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_val_if_fail (list != NULL, NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
if (GTK_NOTEBOOK_PAGE_FROM_LIST (list)->default_tab)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
return GTK_NOTEBOOK_PAGE_FROM_LIST (list)->tab_label;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_tab_label:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the page
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @tab_label: (allow-none): the tab label widget to use, or %NULL
|
|
|
|
|
* for default tab label
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* Changes the tab label for @child.
|
|
|
|
|
* If %NULL is specified for @tab_label, then the page will
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* have the label “page N”.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_tab_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *tab_label)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
GtkNotebookPage *page;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
2001-07-31 21:23:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_if_fail (list != NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
/* a NULL pointer indicates a default_tab setting, otherwise
|
|
|
|
|
* we need to set the associated label
|
|
|
|
|
*/
|
|
|
|
|
page = list->data;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2001-09-26 20:33:23 +00:00
|
|
|
|
if (page->tab_label == tab_label)
|
|
|
|
|
return;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2001-09-26 20:33:23 +00:00
|
|
|
|
gtk_notebook_remove_tab_label (notebook, page);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (tab_label)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
page->default_tab = FALSE;
|
|
|
|
|
page->tab_label = tab_label;
|
2017-05-13 09:38:30 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (page->tab_label), "notebook", notebook);
|
|
|
|
|
gtk_widget_set_parent (page->tab_label, page->tab_widget);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
page->default_tab = TRUE;
|
|
|
|
|
page->tab_label = NULL;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->show_tabs)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
{
|
|
|
|
|
gchar string[32];
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2011-01-04 07:21:38 +00:00
|
|
|
|
g_snprintf (string, sizeof(string), _("Page %u"),
|
|
|
|
|
g_list_position (priv->children, list));
|
|
|
|
|
page->tab_label = gtk_label_new (string);
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_set_parent (page->tab_label, page->tab_widget);
|
|
|
|
|
g_object_set_data (G_OBJECT (page->tab_label), "notebook", notebook);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2001-12-12 20:10:52 +00:00
|
|
|
|
if (page->tab_label)
|
|
|
|
|
page->mnemonic_activate_signal =
|
2002-10-05 23:15:39 +00:00
|
|
|
|
g_signal_connect (page->tab_label,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
"mnemonic-activate",
|
|
|
|
|
G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page),
|
|
|
|
|
notebook);
|
2001-12-12 20:10:52 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->show_tabs && gtk_widget_get_visible (child))
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_widget_show (page->tab_label);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
2003-01-30 21:57:08 +00:00
|
|
|
|
|
2018-10-12 22:12:53 +00:00
|
|
|
|
if (priv->menu)
|
|
|
|
|
gtk_notebook_menu_item_recreate (notebook, list);
|
|
|
|
|
|
2019-03-03 23:21:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (page), "tab-label");
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
}
|
1998-07-19 19:09:27 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_tab_label_text:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the page
|
2001-01-09 16:23:57 +00:00
|
|
|
|
* @tab_text: the label text
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Creates a new label and sets it as the tab label for the page
|
|
|
|
|
* containing @child.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
const gchar *tab_text)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *tab_label = NULL;
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (tab_text)
|
|
|
|
|
tab_label = gtk_label_new (tab_text);
|
|
|
|
|
gtk_notebook_set_tab_label (notebook, child, tab_label);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_tab_label_text:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a widget contained in a page of @notebook
|
|
|
|
|
*
|
|
|
|
|
* Retrieves the text of the tab label for the page containing
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable): 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.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const gchar *
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
2001-06-24 15:34:48 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *tab_label;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
|
|
|
|
|
|
|
|
|
tab_label = gtk_notebook_get_tab_label (notebook, child);
|
|
|
|
|
|
2008-02-06 09:53:34 +00:00
|
|
|
|
if (GTK_IS_LABEL (tab_label))
|
2001-06-24 15:34:48 +00:00
|
|
|
|
return gtk_label_get_text (GTK_LABEL (tab_label));
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_menu_label:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
2001-06-24 15:34:48 +00:00
|
|
|
|
* @child: a widget contained in a page of @notebook
|
2010-09-21 04:18:11 +00:00
|
|
|
|
*
|
2001-06-24 15:34:48 +00:00
|
|
|
|
* Retrieves the menu label widget of the page containing @child.
|
2010-09-21 04:18:11 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the menu label, or %NULL if the
|
|
|
|
|
* notebook page does not have a menu label other than the default (the tab
|
|
|
|
|
* label).
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
1998-11-28 07:42:37 +00:00
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_notebook_get_menu_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
2001-07-31 21:23:19 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_val_if_fail (list != NULL, NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
if (GTK_NOTEBOOK_PAGE_FROM_LIST (list)->default_menu)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
return GTK_NOTEBOOK_PAGE_FROM_LIST (list)->menu_label;
|
2010-09-21 04:18:11 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_menu_label:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the child widget
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @menu_label: (allow-none): the menu label, or %NULL for default
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
|
|
|
|
* Changes the menu label for the page containing @child.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
1998-02-19 05:13:46 +00:00
|
|
|
|
void
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_set_menu_label (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
GtkWidget *menu_label)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
GtkNotebookPage *page;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GList *list;
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
2001-07-31 21:23:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
1998-02-19 05:13:46 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_if_fail (list != NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
|
|
|
|
page = list->data;
|
|
|
|
|
if (page->menu_label)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu)
|
2011-01-04 07:21:38 +00:00
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->menu),
|
2010-09-08 06:03:14 +00:00
|
|
|
|
gtk_widget_get_parent (page->menu_label));
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
2019-02-20 13:39:21 +00:00
|
|
|
|
g_clear_object (&page->menu_label);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (menu_label)
|
|
|
|
|
{
|
|
|
|
|
page->menu_label = menu_label;
|
2005-11-23 18:06:58 +00:00
|
|
|
|
g_object_ref_sink (page->menu_label);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
page->default_menu = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
page->default_menu = TRUE;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->menu)
|
2019-02-20 13:39:21 +00:00
|
|
|
|
gtk_notebook_menu_item_create (notebook, page);
|
2019-03-03 23:21:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (page), "menu-label");
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_menu_label_text:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the child widget
|
|
|
|
|
* @menu_text: the label text
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Creates a new label and sets it as the menu label of @child.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
const gchar *menu_text)
|
1998-02-19 05:13:46 +00:00
|
|
|
|
{
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
GtkWidget *menu_label = NULL;
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
if (menu_text)
|
2007-01-06 03:02:31 +00:00
|
|
|
|
{
|
|
|
|
|
menu_label = gtk_label_new (menu_text);
|
2011-05-20 01:48:22 +00:00
|
|
|
|
gtk_widget_set_halign (menu_label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (menu_label, GTK_ALIGN_CENTER);
|
2007-01-06 03:02:31 +00:00
|
|
|
|
}
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gtk_notebook_set_menu_label (notebook, child, menu_label);
|
1998-02-19 05:13:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_menu_label_text:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the child widget of a page of the notebook.
|
|
|
|
|
*
|
|
|
|
|
* Retrieves the text of the menu label for the page containing
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @child.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable): 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.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const gchar *
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
2001-06-24 15:34:48 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *menu_label;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
menu_label = gtk_notebook_get_menu_label (notebook, child);
|
|
|
|
|
|
2008-02-06 09:53:34 +00:00
|
|
|
|
if (GTK_IS_LABEL (menu_label))
|
2001-06-24 15:34:48 +00:00
|
|
|
|
return gtk_label_get_text (GTK_LABEL (menu_label));
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2011-01-04 07:21:38 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/* Helper function called when pages are reordered
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_child_reordered (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkNotebookPage *page)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
2015-09-06 23:44:53 +00:00
|
|
|
|
GList *list;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
GtkCssNode *sibling;
|
2015-09-06 23:44:53 +00:00
|
|
|
|
|
|
|
|
|
list = g_list_find (priv->children, page);
|
2010-07-13 15:47:05 +00:00
|
|
|
|
|
|
|
|
|
if (priv->menu)
|
2018-10-12 22:12:53 +00:00
|
|
|
|
gtk_notebook_menu_item_recreate (notebook, list);
|
2003-01-30 21:57:08 +00:00
|
|
|
|
|
2015-11-08 20:01:09 +00:00
|
|
|
|
if (list->prev)
|
2019-02-19 23:28:53 +00:00
|
|
|
|
sibling = gtk_widget_get_css_node (GTK_NOTEBOOK_PAGE_FROM_LIST (list->prev)->tab_widget);
|
2017-05-11 05:48:46 +00:00
|
|
|
|
else if (priv->arrow_widget[ARROW_RIGHT_BEFORE])
|
|
|
|
|
sibling = gtk_widget_get_css_node (priv->arrow_widget[ARROW_RIGHT_BEFORE]);
|
|
|
|
|
else if (priv->arrow_widget[ARROW_LEFT_BEFORE])
|
|
|
|
|
sibling = gtk_widget_get_css_node (priv->arrow_widget[ARROW_LEFT_BEFORE]);
|
2015-11-08 20:01:09 +00:00
|
|
|
|
else
|
2016-01-06 16:41:41 +00:00
|
|
|
|
sibling = NULL;
|
2015-11-08 20:01:09 +00:00
|
|
|
|
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gtk_css_node_insert_after (gtk_widget_get_css_node (priv->tabs_widget),
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_widget_get_css_node (page->tab_widget),
|
2015-12-25 01:39:43 +00:00
|
|
|
|
sibling);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_update_labels (notebook);
|
2017-05-11 06:09:14 +00:00
|
|
|
|
gtk_widget_queue_allocate (priv->tabs_widget);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_reorder_child:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: the child to move
|
2002-03-01 15:41:59 +00:00
|
|
|
|
* @position: the new position, or -1 to move to the end
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2000-12-11 17:47:24 +00:00
|
|
|
|
* Reorders the page containing @child, so that it appears in position
|
2002-03-01 15:41:59 +00:00
|
|
|
|
* @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.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_reorder_child (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
gint position)
|
1998-11-06 22:05:02 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GList *list, *new_list;
|
|
|
|
|
GtkNotebookPage *page;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
gint old_pos;
|
2002-03-01 15:41:59 +00:00
|
|
|
|
gint max_pos;
|
2012-02-07 16:02:15 +00:00
|
|
|
|
gint i;
|
1998-11-06 22:05:02 +00:00
|
|
|
|
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
1998-11-06 22:05:02 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_if_fail (list != NULL);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
max_pos = g_list_length (priv->children) - 1;
|
2002-03-01 15:41:59 +00:00
|
|
|
|
if (position < 0 || position > max_pos)
|
|
|
|
|
position = max_pos;
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
old_pos = g_list_position (priv->children, list);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
|
|
|
|
|
if (old_pos == position)
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
page = list->data;
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->children = g_list_delete_link (priv->children, list);
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv->children = g_list_insert (priv->children, page, position);
|
|
|
|
|
new_list = g_list_nth (priv->children, position);
|
1998-11-30 17:19:59 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/* Fix up GList references in GtkNotebook structure */
|
2010-07-13 15:47:05 +00:00
|
|
|
|
if (priv->first_tab == list)
|
|
|
|
|
priv->first_tab = new_list;
|
|
|
|
|
if (priv->focus_tab == list)
|
|
|
|
|
priv->focus_tab = new_list;
|
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.
1998-11-16 23:40:50 +00:00
|
|
|
|
|
2003-09-03 19:57:05 +00:00
|
|
|
|
/* Move around the menu items if necessary */
|
2000-12-11 17:47:24 +00:00
|
|
|
|
gtk_notebook_child_reordered (notebook, page);
|
2012-02-07 16:02:15 +00:00
|
|
|
|
|
2012-02-16 10:24:21 +00:00
|
|
|
|
for (list = priv->children, i = 0; list; list = list->next, i++)
|
2012-02-07 16:02:15 +00:00
|
|
|
|
{
|
|
|
|
|
if (MIN (old_pos, position) <= i && i <= MAX (old_pos, position))
|
2019-02-21 04:39:01 +00:00
|
|
|
|
g_object_notify (G_OBJECT (list->data), "position");
|
2012-02-07 16:02:15 +00:00
|
|
|
|
}
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2006-03-08 17:22:14 +00:00
|
|
|
|
g_signal_emit (notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
notebook_signals[PAGE_REORDERED],
|
|
|
|
|
0,
|
|
|
|
|
child,
|
|
|
|
|
position);
|
1998-11-06 22:05:02 +00:00
|
|
|
|
}
|
2005-03-20 07:01:23 +00:00
|
|
|
|
|
2007-05-19 05:22:00 +00:00
|
|
|
|
/**
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* gtk_notebook_set_group_name:
|
2007-05-19 05:22:00 +00:00
|
|
|
|
* @notebook: a #GtkNotebook
|
2010-10-01 17:05:12 +00:00
|
|
|
|
* @group_name: (allow-none): the name of the notebook group,
|
|
|
|
|
* or %NULL to unset it
|
2010-09-24 15:13:30 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets a group name for @notebook.
|
2007-05-19 05:22:00 +00:00
|
|
|
|
*
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* Notebooks with the same name will be able to exchange tabs
|
|
|
|
|
* via drag and drop. A notebook with a %NULL group name will
|
2007-05-19 05:22:00 +00:00
|
|
|
|
* not be able to exchange tabs with any other notebook.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2010-09-24 15:13:30 +00:00
|
|
|
|
gtk_notebook_set_group_name (GtkNotebook *notebook,
|
|
|
|
|
const gchar *group_name)
|
2007-05-19 05:22:00 +00:00
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2010-09-26 13:02:00 +00:00
|
|
|
|
GQuark group;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
group = g_quark_from_string (group_name);
|
|
|
|
|
|
2007-05-19 05:22:00 +00:00
|
|
|
|
if (priv->group != group)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2007-05-19 05:22:00 +00:00
|
|
|
|
priv->group = group;
|
2015-09-07 22:53:06 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_GROUP_NAME]);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-19 05:22:00 +00:00
|
|
|
|
/**
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* gtk_notebook_get_group_name:
|
2007-05-19 05:22:00 +00:00
|
|
|
|
* @notebook: a #GtkNotebook
|
2010-09-21 04:18:11 +00:00
|
|
|
|
*
|
2010-09-24 15:13:30 +00:00
|
|
|
|
* Gets the current group name for @notebook.
|
2010-09-21 04:18:11 +00:00
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the group name, or %NULL if none is set
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2010-09-24 15:13:30 +00:00
|
|
|
|
const gchar *
|
|
|
|
|
gtk_notebook_get_group_name (GtkNotebook *notebook)
|
2007-05-19 05:22:00 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
|
2010-09-24 15:13:30 +00:00
|
|
|
|
return g_quark_to_string (notebook->priv->group);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_tab_reorderable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child #GtkWidget
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* Gets whether the tab can be reordered via drag and drop or not.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the tab is reorderable.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_val_if_fail (list != NULL, FALSE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
return GTK_NOTEBOOK_PAGE_FROM_LIST (list)->reorderable;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_tab_reorderable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child #GtkWidget
|
2011-01-04 07:21:38 +00:00
|
|
|
|
* @reorderable: whether the tab is reorderable or not
|
2006-02-23 17:59:33 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets whether the notebook tab can be reordered
|
|
|
|
|
* via drag and drop or not.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-02-23 17:59:33 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
gboolean reorderable)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2015-09-07 09:52:55 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_if_fail (list != NULL);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
page = GTK_NOTEBOOK_PAGE_FROM_LIST (list);
|
2013-04-24 23:58:22 +00:00
|
|
|
|
reorderable = reorderable != FALSE;
|
|
|
|
|
|
2015-09-07 09:52:55 +00:00
|
|
|
|
if (page->reorderable != reorderable)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2015-09-07 09:52:55 +00:00
|
|
|
|
page->reorderable = reorderable;
|
|
|
|
|
if (reorderable)
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_widget),
|
2017-05-11 06:50:49 +00:00
|
|
|
|
"reorderable-page");
|
2015-09-07 09:52:55 +00:00
|
|
|
|
else
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_style_context_remove_class (gtk_widget_get_style_context (page->tab_widget),
|
2017-05-11 06:50:49 +00:00
|
|
|
|
"reorderable-page");
|
2019-03-03 23:21:10 +00:00
|
|
|
|
g_object_notify (G_OBJECT (page), "reorderable");
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_tab_detachable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child #GtkWidget
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2006-02-23 17:59:33 +00:00
|
|
|
|
* Returns whether the tab contents can be detached from @notebook.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the tab is detachable.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-02-23 17:59:33 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_val_if_fail (list != NULL, FALSE);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-02-19 23:28:53 +00:00
|
|
|
|
return GTK_NOTEBOOK_PAGE_FROM_LIST (list)->detachable;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_tab_detachable:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child #GtkWidget
|
|
|
|
|
* @detachable: whether the tab is detachable or not
|
|
|
|
|
*
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* Sets whether the tab can be detached from @notebook to another
|
|
|
|
|
* notebook or widget.
|
2006-02-23 17:59:33 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that 2 notebooks must share a common group identificator
|
2011-01-04 03:55:38 +00:00
|
|
|
|
* (see gtk_notebook_set_group_name()) to allow automatic tabs
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* interchange between them.
|
|
|
|
|
*
|
|
|
|
|
* If you want a widget to interact with a notebook through DnD
|
|
|
|
|
* (i.e.: accept dragged tabs from it) it must be set as a drop
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* destination and accept the target “GTK_NOTEBOOK_TAB”. The notebook
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* will fill the selection with a GtkWidget** pointing to the child
|
|
|
|
|
* widget that corresponds to the dropped tab.
|
2015-02-12 22:33:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that you should use gtk_notebook_detach_tab() instead
|
|
|
|
|
* of gtk_container_remove() if you want to remove the tab from
|
|
|
|
|
* the source notebook as part of accepting a drop. Otherwise,
|
|
|
|
|
* the source notebook will think that the dragged tab was
|
|
|
|
|
* removed from underneath the ongoing drag operation, and
|
|
|
|
|
* will initiate a drag cancel animation.
|
|
|
|
|
*
|
2014-01-27 19:55:18 +00:00
|
|
|
|
* |[<!-- language="C" -->
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* static void
|
2014-02-12 21:09:09 +00:00
|
|
|
|
* on_drag_data_received (GtkWidget *widget,
|
2018-06-29 17:34:14 +00:00
|
|
|
|
* GdkDrag *drag,
|
2014-02-12 21:09:09 +00:00
|
|
|
|
* GtkSelectionData *data,
|
|
|
|
|
* guint time,
|
|
|
|
|
* gpointer user_data)
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* {
|
|
|
|
|
* GtkWidget *notebook;
|
|
|
|
|
* GtkWidget **child;
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*
|
2018-06-29 17:34:14 +00:00
|
|
|
|
* notebook = gtk_drag_get_source_widget (drag);
|
2014-02-12 21:09:09 +00:00
|
|
|
|
* child = (void*) gtk_selection_data_get_data (data);
|
2010-12-16 00:16:00 +00:00
|
|
|
|
*
|
2018-01-03 13:01:38 +00:00
|
|
|
|
* // process_widget (*child);
|
|
|
|
|
*
|
2015-02-12 22:33:10 +00:00
|
|
|
|
* gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child);
|
2006-03-22 16:11:48 +00:00
|
|
|
|
* }
|
2007-11-25 06:51:19 +00:00
|
|
|
|
* ]|
|
2006-03-22 16:11:48 +00:00
|
|
|
|
*
|
|
|
|
|
* If you want a notebook to accept drags from other widgets,
|
|
|
|
|
* you will have to set your own DnD code to do it.
|
2011-01-04 07:21:38 +00:00
|
|
|
|
*/
|
2006-02-23 17:59:33 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *child,
|
|
|
|
|
gboolean detachable)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
|
|
|
|
GList *list;
|
2019-03-03 23:21:10 +00:00
|
|
|
|
GtkNotebookPage *page;
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
|
|
|
|
|
2015-09-09 00:55:32 +00:00
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
g_return_if_fail (list != NULL);
|
2006-02-23 17:59:33 +00:00
|
|
|
|
|
2019-03-03 23:21:10 +00:00
|
|
|
|
page = GTK_NOTEBOOK_PAGE_FROM_LIST (list);
|
2013-04-24 23:58:22 +00:00
|
|
|
|
detachable = detachable != FALSE;
|
|
|
|
|
|
2019-03-03 23:21:10 +00:00
|
|
|
|
if (page->detachable != detachable)
|
2006-02-23 17:59:33 +00:00
|
|
|
|
{
|
2019-03-03 23:21:10 +00:00
|
|
|
|
page->detachable = detachable;
|
|
|
|
|
g_object_notify (G_OBJECT (page), "detachable");
|
2006-02-23 17:59:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-09 02:25:05 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_action_widget:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @pack_type: pack type of the action widget to receive
|
|
|
|
|
*
|
|
|
|
|
* Gets one of the action widgets. See gtk_notebook_set_action_widget().
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): The action widget with the given
|
|
|
|
|
* @pack_type or %NULL when this action widget has not been set
|
2009-11-09 02:25:05 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_notebook_get_action_widget (GtkNotebook *notebook,
|
|
|
|
|
GtkPackType pack_type)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
return notebook->priv->action_widget[pack_type];
|
2009-11-09 02:25:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_set_action_widget:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @widget: a #GtkWidget
|
|
|
|
|
* @pack_type: pack type of the action widget
|
|
|
|
|
*
|
2009-11-09 15:36:17 +00:00
|
|
|
|
* Sets @widget as one of the action widgets. Depending on the pack type
|
|
|
|
|
* the widget will be placed before or after the tabs. You can use
|
|
|
|
|
* a #GtkBox if you need to pack more than one widget on the same side.
|
2009-11-09 02:25:05 +00:00
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Note that action widgets are “internal” children of the notebook and thus
|
2009-11-10 14:40:29 +00:00
|
|
|
|
* not included in the list returned from gtk_container_foreach().
|
2009-11-09 02:25:05 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_notebook_set_action_widget (GtkNotebook *notebook,
|
2011-01-04 07:21:38 +00:00
|
|
|
|
GtkWidget *widget,
|
2009-11-09 02:25:05 +00:00
|
|
|
|
GtkPackType pack_type)
|
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
|
GtkNotebookPrivate *priv;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
|
|
|
|
g_return_if_fail (!widget || GTK_IS_WIDGET (widget));
|
2010-09-08 06:03:14 +00:00
|
|
|
|
g_return_if_fail (!widget || gtk_widget_get_parent (widget) == NULL);
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
2010-07-13 15:47:05 +00:00
|
|
|
|
priv = notebook->priv;
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
|
|
|
|
if (priv->action_widget[pack_type])
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->header_widget), priv->action_widget[pack_type]);
|
2009-11-09 02:25:05 +00:00
|
|
|
|
|
|
|
|
|
priv->action_widget[pack_type] = widget;
|
|
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
|
{
|
2017-05-13 09:38:30 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->header_widget), widget);
|
2019-01-22 23:44:34 +00:00
|
|
|
|
if (pack_type == GTK_PACK_START)
|
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->header_widget), widget, NULL);
|
|
|
|
|
else
|
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (priv->header_widget), widget, gtk_widget_get_last_child (priv->header_widget));
|
2010-07-13 15:47:05 +00:00
|
|
|
|
gtk_widget_set_child_visible (widget, priv->show_tabs);
|
2009-11-09 02:25:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
|
|
|
|
}
|
2019-02-20 04:03:22 +00:00
|
|
|
|
|
2019-02-24 04:26:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_page:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
* @child: a child of @notebook
|
|
|
|
|
*
|
|
|
|
|
* Returns the #GtkNotebookPage for @child.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): the #GtkNotebookPage for @child
|
|
|
|
|
*/
|
2019-02-20 04:03:22 +00:00
|
|
|
|
GtkNotebookPage *
|
|
|
|
|
gtk_notebook_get_page (GtkNotebook *notebook,
|
|
|
|
|
GtkWidget *child)
|
|
|
|
|
{
|
|
|
|
|
GList *list;
|
|
|
|
|
GtkNotebookPage *page = NULL;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
|
|
|
|
|
|
|
|
|
|
list = gtk_notebook_find_child (notebook, child);
|
|
|
|
|
if (list != NULL)
|
|
|
|
|
page = list->data;
|
|
|
|
|
|
|
|
|
|
return page;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-24 04:26:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_page_get_child:
|
|
|
|
|
* @page: a #GtkNotebookPage
|
|
|
|
|
*
|
|
|
|
|
* Returns the notebook child to which @page belongs.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): the child to which @page belongs
|
|
|
|
|
*/
|
2019-02-20 04:03:22 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_notebook_page_get_child (GtkNotebookPage *page)
|
|
|
|
|
{
|
|
|
|
|
return page->child;
|
|
|
|
|
}
|
2019-02-21 02:46:20 +00:00
|
|
|
|
|
|
|
|
|
#define GTK_TYPE_NOTEBOOK_PAGES (gtk_notebook_pages_get_type ())
|
|
|
|
|
G_DECLARE_FINAL_TYPE (GtkNotebookPages, gtk_notebook_pages, GTK, NOTEBOOK_PAGES, GObject)
|
|
|
|
|
|
|
|
|
|
struct _GtkNotebookPages
|
|
|
|
|
{
|
|
|
|
|
GObject parent_instance;
|
|
|
|
|
GtkNotebook *notebook;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _GtkNotebookPagesClass
|
|
|
|
|
{
|
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static GType
|
|
|
|
|
gtk_notebook_pages_get_item_type (GListModel *model)
|
|
|
|
|
{
|
|
|
|
|
return GTK_TYPE_NOTEBOOK_PAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static guint
|
|
|
|
|
gtk_notebook_pages_get_n_items (GListModel *model)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPages *pages = GTK_NOTEBOOK_PAGES (model);
|
|
|
|
|
|
|
|
|
|
return g_list_length (pages->notebook->priv->children);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static gpointer
|
|
|
|
|
gtk_notebook_pages_get_item (GListModel *model,
|
|
|
|
|
guint position)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPages *pages = GTK_NOTEBOOK_PAGES (model);
|
|
|
|
|
GtkNotebookPage *page;
|
|
|
|
|
|
|
|
|
|
page = g_list_nth_data (pages->notebook->priv->children, position);
|
|
|
|
|
|
|
|
|
|
return g_object_ref (page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_pages_list_model_init (GListModelInterface *iface)
|
|
|
|
|
{
|
|
|
|
|
iface->get_item_type = gtk_notebook_pages_get_item_type;
|
|
|
|
|
iface->get_n_items = gtk_notebook_pages_get_n_items;
|
|
|
|
|
iface->get_item = gtk_notebook_pages_get_item;
|
|
|
|
|
}
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkNotebookPages, gtk_notebook_pages, G_TYPE_OBJECT,
|
|
|
|
|
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_notebook_pages_list_model_init))
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_pages_init (GtkNotebookPages *pages)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_notebook_pages_class_init (GtkNotebookPagesClass *class)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GtkNotebookPages *
|
|
|
|
|
gtk_notebook_pages_new (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPages *pages;
|
|
|
|
|
|
|
|
|
|
pages = g_object_new (GTK_TYPE_NOTEBOOK_PAGES, NULL);
|
|
|
|
|
pages->notebook = notebook;
|
|
|
|
|
|
|
|
|
|
return pages;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-24 04:26:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_notebook_get_pages:
|
|
|
|
|
* @notebook: a #GtkNotebook
|
|
|
|
|
*
|
|
|
|
|
* Returns a #GListModel that contains the pages of the notebook,
|
|
|
|
|
* and can be used to keep an up-to-date view.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): a #GListModel for the notebook's children
|
|
|
|
|
*/
|
2019-02-21 02:46:20 +00:00
|
|
|
|
GListModel *
|
|
|
|
|
gtk_notebook_get_pages (GtkNotebook *notebook)
|
|
|
|
|
{
|
|
|
|
|
GtkNotebookPrivate *priv = notebook->priv;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
|
|
|
|
|
|
|
|
|
if (priv->pages)
|
|
|
|
|
return g_object_ref (priv->pages);
|
|
|
|
|
|
|
|
|
|
priv->pages = G_LIST_MODEL (gtk_notebook_pages_new (notebook));
|
|
|
|
|
|
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (priv->pages), (gpointer *)&priv->pages);
|
|
|
|
|
|
|
|
|
|
return priv->pages;
|
|
|
|
|
}
|
|
|
|
|
|