1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
2004-03-09 22:14:30 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Jsh MacDonald
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
|
|
|
* 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
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
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
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2004-03-06 03:38:59 +00:00
|
|
|
#include <config.h>
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
#include "gtkintl.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtkmenu.h"
|
|
|
|
#include "gtkmenuitem.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
#include "gtkmarshalers.h"
|
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
|
|
|
#include "gdk/gdkkeysyms.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2003-10-10 17:18:34 +00:00
|
|
|
#undef GTK_DISABLE_DEPRECATED
|
|
|
|
#include "gtkoptionmenu.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
#include "gtkalias.h"
|
|
|
|
|
2001-12-04 03:27:30 +00:00
|
|
|
#define CHILD_LEFT_SPACING 4
|
1997-11-24 22:37:52 +00:00
|
|
|
#define CHILD_RIGHT_SPACING 1
|
|
|
|
#define CHILD_TOP_SPACING 1
|
|
|
|
#define CHILD_BOTTOM_SPACING 1
|
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
typedef struct _GtkOptionMenuProps GtkOptionMenuProps;
|
|
|
|
|
|
|
|
struct _GtkOptionMenuProps
|
|
|
|
{
|
2001-04-30 23:23:54 +00:00
|
|
|
gboolean interior_focus;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GtkRequisition indicator_size;
|
|
|
|
GtkBorder indicator_spacing;
|
2001-12-04 03:27:30 +00:00
|
|
|
gint focus_width;
|
|
|
|
gint focus_pad;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
};
|
|
|
|
|
2002-12-10 21:39:53 +00:00
|
|
|
static const GtkOptionMenuProps default_props = {
|
2001-12-04 03:27:30 +00:00
|
|
|
TRUE,
|
2001-05-01 01:36:33 +00:00
|
|
|
{ 7, 13 },
|
2001-12-04 03:27:30 +00:00
|
|
|
{ 7, 5, 2, 2 }, /* Left, right, top, bottom */
|
|
|
|
1,
|
|
|
|
0
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void gtk_option_menu_destroy (GtkObject *object);
|
2001-10-31 23:49:09 +00:00
|
|
|
static void gtk_option_menu_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_option_menu_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_option_menu_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_option_menu_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static void gtk_option_menu_paint (GtkWidget *widget,
|
|
|
|
GdkRectangle *area);
|
|
|
|
static gint gtk_option_menu_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_option_menu_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
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 gint gtk_option_menu_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
2001-08-17 16:33:04 +00:00
|
|
|
static void gtk_option_menu_selection_done (GtkMenuShell *menu_shell,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkOptionMenu *option_menu);
|
|
|
|
static void gtk_option_menu_update_contents (GtkOptionMenu *option_menu);
|
|
|
|
static void gtk_option_menu_remove_contents (GtkOptionMenu *option_menu);
|
|
|
|
static void gtk_option_menu_calc_size (GtkOptionMenu *option_menu);
|
|
|
|
static void gtk_option_menu_position (GtkMenu *menu,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
gint *scroll_offet,
|
1997-11-24 22:37:52 +00:00
|
|
|
gpointer user_data);
|
1998-01-02 20:22:38 +00:00
|
|
|
static void gtk_option_menu_show_all (GtkWidget *widget);
|
|
|
|
static void gtk_option_menu_hide_all (GtkWidget *widget);
|
2001-10-16 19:45:34 +00:00
|
|
|
static gboolean gtk_option_menu_mnemonic_activate (GtkWidget *widget,
|
|
|
|
gboolean group_cycling);
|
2002-10-09 23:55:27 +00:00
|
|
|
static GType gtk_option_menu_child_type (GtkContainer *container);
|
2001-09-17 02:19:01 +00:00
|
|
|
static gint gtk_option_menu_scroll_event (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
CHANGED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-10-31 23:49:09 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_MENU,
|
|
|
|
LAST_PROP
|
|
|
|
};
|
|
|
|
|
2006-05-14 04:25:34 +00:00
|
|
|
static guint signals[LAST_SIGNAL] = { 0 };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2006-05-14 04:25:34 +00:00
|
|
|
G_DEFINE_TYPE (GtkOptionMenu, gtk_option_menu, GTK_TYPE_BUTTON)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_class_init (GtkOptionMenuClass *class)
|
|
|
|
{
|
2001-10-31 23:49:09 +00:00
|
|
|
GObjectClass *gobject_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
1998-06-16 05:20:05 +00:00
|
|
|
GtkContainerClass *container_class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-10-31 23:49:09 +00:00
|
|
|
gobject_class = (GObjectClass*) class;
|
1997-11-24 22:37:52 +00:00
|
|
|
object_class = (GtkObjectClass*) class;
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
1998-06-16 05:20:05 +00:00
|
|
|
container_class = (GtkContainerClass*) class;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
signals[CHANGED] =
|
2005-09-01 05:11:46 +00:00
|
|
|
g_signal_new (I_("changed"),
|
2001-06-29 16:30:25 +00:00
|
|
|
G_OBJECT_CLASS_TYPE (class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkOptionMenuClass, changed),
|
|
|
|
NULL, NULL,
|
2001-11-17 23:28:51 +00:00
|
|
|
_gtk_marshal_VOID__VOID,
|
2001-06-29 16:30:25 +00:00
|
|
|
G_TYPE_NONE, 0);
|
2001-10-31 23:49:09 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = gtk_option_menu_set_property;
|
|
|
|
gobject_class->get_property = gtk_option_menu_get_property;
|
1997-11-24 22:37:52 +00:00
|
|
|
object_class->destroy = gtk_option_menu_destroy;
|
2000-12-04 01:15:37 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class->size_request = gtk_option_menu_size_request;
|
|
|
|
widget_class->size_allocate = gtk_option_menu_size_allocate;
|
|
|
|
widget_class->expose_event = gtk_option_menu_expose;
|
|
|
|
widget_class->button_press_event = gtk_option_menu_button_press;
|
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
|
|
|
widget_class->key_press_event = gtk_option_menu_key_press;
|
2001-09-17 02:19:01 +00:00
|
|
|
widget_class->scroll_event = gtk_option_menu_scroll_event;
|
1998-01-02 20:22:38 +00:00
|
|
|
widget_class->show_all = gtk_option_menu_show_all;
|
|
|
|
widget_class->hide_all = gtk_option_menu_hide_all;
|
2001-10-16 19:45:34 +00:00
|
|
|
widget_class->mnemonic_activate = gtk_option_menu_mnemonic_activate;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
|
|
|
container_class->child_type = gtk_option_menu_child_type;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
2001-10-31 23:49:09 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_MENU,
|
|
|
|
g_param_spec_object ("menu",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Menu"),
|
|
|
|
P_("The menu of options"),
|
2001-10-31 23:49:09 +00:00
|
|
|
GTK_TYPE_MENU,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-10-31 23:49:09 +00:00
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_boxed ("indicator-size",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Indicator Size"),
|
|
|
|
P_("Size of dropdown indicator"),
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GTK_TYPE_REQUISITION,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_boxed ("indicator-spacing",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Indicator Spacing"),
|
|
|
|
P_("Spacing around indicator"),
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GTK_TYPE_BORDER,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
2002-10-09 23:55:27 +00:00
|
|
|
static GType
|
1998-06-16 05:20:05 +00:00
|
|
|
gtk_option_menu_child_type (GtkContainer *container)
|
|
|
|
{
|
2002-10-09 23:55:27 +00:00
|
|
|
return G_TYPE_NONE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_init (GtkOptionMenu *option_menu)
|
|
|
|
{
|
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
|
|
|
GTK_WIDGET_SET_FLAGS (option_menu, GTK_CAN_FOCUS);
|
1999-01-25 19:05:58 +00:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (option_menu, GTK_CAN_DEFAULT | GTK_RECEIVES_DEFAULT);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
option_menu->menu = NULL;
|
|
|
|
option_menu->menu_item = NULL;
|
|
|
|
option_menu->width = 0;
|
|
|
|
option_menu->height = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_option_menu_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2002-10-09 23:55:27 +00:00
|
|
|
return g_object_new (GTK_TYPE_OPTION_MENU, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
gtk_option_menu_get_menu (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_OPTION_MENU (option_menu), NULL);
|
|
|
|
|
|
|
|
return option_menu->menu;
|
|
|
|
}
|
|
|
|
|
1998-02-03 14:13:05 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_detacher (GtkWidget *widget,
|
|
|
|
GtkMenu *menu)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
|
|
|
|
|
|
|
option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
g_return_if_fail (option_menu->menu == (GtkWidget*) menu);
|
|
|
|
|
|
|
|
gtk_option_menu_remove_contents (option_menu);
|
2002-10-09 23:55:27 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (option_menu->menu,
|
|
|
|
gtk_option_menu_selection_done,
|
|
|
|
option_menu);
|
|
|
|
g_signal_handlers_disconnect_by_func (option_menu->menu,
|
|
|
|
gtk_option_menu_calc_size,
|
|
|
|
option_menu);
|
1998-02-03 14:13:05 +00:00
|
|
|
|
|
|
|
option_menu->menu = NULL;
|
2001-10-31 23:49:09 +00:00
|
|
|
g_object_notify (G_OBJECT (option_menu), "menu");
|
1998-02-03 14:13:05 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_option_menu_set_menu (GtkOptionMenu *option_menu,
|
|
|
|
GtkWidget *menu)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
g_return_if_fail (GTK_IS_MENU (menu));
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
if (option_menu->menu != menu)
|
|
|
|
{
|
|
|
|
gtk_option_menu_remove_menu (option_menu);
|
1998-02-03 14:13:05 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
option_menu->menu = menu;
|
1998-02-03 14:13:05 +00:00
|
|
|
gtk_menu_attach_to_widget (GTK_MENU (menu),
|
|
|
|
GTK_WIDGET (option_menu),
|
|
|
|
gtk_option_menu_detacher);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_option_menu_calc_size (option_menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2006-07-06 05:14:03 +00:00
|
|
|
g_signal_connect_after (option_menu->menu, "selection-done",
|
2002-10-09 23:55:27 +00:00
|
|
|
G_CALLBACK (gtk_option_menu_selection_done),
|
|
|
|
option_menu);
|
|
|
|
g_signal_connect_swapped (option_menu->menu, "size_request",
|
|
|
|
G_CALLBACK (gtk_option_menu_calc_size),
|
2001-08-17 16:33:04 +00:00
|
|
|
option_menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
if (GTK_WIDGET (option_menu)->parent)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (option_menu));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_option_menu_update_contents (option_menu);
|
2001-10-31 23:49:09 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (option_menu), "menu");
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_option_menu_remove_menu (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
|
|
|
if (option_menu->menu)
|
2002-05-14 22:44:51 +00:00
|
|
|
{
|
|
|
|
if (GTK_MENU_SHELL (option_menu->menu)->active)
|
2003-12-21 00:59:46 +00:00
|
|
|
gtk_menu_shell_cancel (GTK_MENU_SHELL (option_menu->menu));
|
2002-05-14 22:44:51 +00:00
|
|
|
|
|
|
|
gtk_menu_detach (GTK_MENU (option_menu->menu));
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_option_menu_set_history (GtkOptionMenu *option_menu,
|
1998-03-09 15:16:28 +00:00
|
|
|
guint index)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkWidget *menu_item;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
|
|
|
if (option_menu->menu)
|
|
|
|
{
|
|
|
|
gtk_menu_set_active (GTK_MENU (option_menu->menu), index);
|
|
|
|
menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
|
|
|
|
|
|
|
if (menu_item != option_menu->menu_item)
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
gtk_option_menu_update_contents (option_menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
/**
|
|
|
|
* gtk_option_menu_get_history:
|
|
|
|
* @option_menu: a #GtkOptionMenu
|
|
|
|
*
|
|
|
|
* Retrieves the index of the currently selected menu item. The menu
|
|
|
|
* items are numbered from top to bottom, starting with 0.
|
|
|
|
*
|
|
|
|
* Return value: index of the selected menu item, or -1 if there are no menu items
|
2005-12-20 05:33:19 +00:00
|
|
|
* Deprecated: 2.4: Use #GtkComboBox instead.
|
2001-02-03 01:09:41 +00:00
|
|
|
**/
|
1999-12-03 20:15:32 +00:00
|
|
|
gint
|
|
|
|
gtk_option_menu_get_history (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
GtkWidget *active_widget;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_OPTION_MENU (option_menu), -1);
|
|
|
|
|
2000-02-17 22:12:25 +00:00
|
|
|
if (option_menu->menu)
|
|
|
|
{
|
|
|
|
active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
|
|
|
|
|
|
|
if (active_widget)
|
|
|
|
return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children,
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
active_widget);
|
2000-02-17 22:12:25 +00:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
1999-12-03 20:15:32 +00:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-10-31 23:49:09 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu = GTK_OPTION_MENU (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_MENU:
|
|
|
|
gtk_option_menu_set_menu (option_menu, g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu = GTK_OPTION_MENU (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_MENU:
|
|
|
|
g_value_set_object (value, option_menu->menu);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (object));
|
|
|
|
|
|
|
|
option_menu = GTK_OPTION_MENU (object);
|
|
|
|
|
|
|
|
if (option_menu->menu)
|
1998-02-03 15:14:35 +00:00
|
|
|
gtk_widget_destroy (option_menu->menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
if (GTK_OBJECT_CLASS (gtk_option_menu_parent_class)->destroy)
|
|
|
|
(* GTK_OBJECT_CLASS (gtk_option_menu_parent_class)->destroy) (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_get_props (GtkOptionMenu *option_menu,
|
|
|
|
GtkOptionMenuProps *props)
|
|
|
|
{
|
|
|
|
GtkRequisition *indicator_size;
|
|
|
|
GtkBorder *indicator_spacing;
|
|
|
|
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (option_menu),
|
2006-07-06 05:14:03 +00:00
|
|
|
"indicator-size", &indicator_size,
|
|
|
|
"indicator-spacing", &indicator_spacing,
|
|
|
|
"interior-focus", &props->interior_focus,
|
|
|
|
"focus-line-width", &props->focus_width,
|
|
|
|
"focus-padding", &props->focus_pad,
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (indicator_size)
|
2001-04-02 19:09:56 +00:00
|
|
|
props->indicator_size = *indicator_size;
|
|
|
|
else
|
|
|
|
props->indicator_size = default_props.indicator_size;
|
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
if (indicator_spacing)
|
2001-04-02 19:09:56 +00:00
|
|
|
props->indicator_spacing = *indicator_spacing;
|
|
|
|
else
|
|
|
|
props->indicator_spacing = default_props.indicator_spacing;
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
|
|
|
|
g_free (indicator_size);
|
2007-01-03 17:31:57 +00:00
|
|
|
gtk_border_free (indicator_spacing);
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GtkOptionMenu *option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
GtkOptionMenuProps props;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint tmp;
|
2000-07-02 18:41:29 +00:00
|
|
|
GtkRequisition child_requisition = { 0, 0 };
|
|
|
|
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
gtk_option_menu_get_props (option_menu, &props);
|
|
|
|
|
2000-07-02 18:41:29 +00:00
|
|
|
if (GTK_BIN (option_menu)->child && GTK_WIDGET_VISIBLE (GTK_BIN (option_menu)->child))
|
|
|
|
{
|
|
|
|
gtk_widget_size_request (GTK_BIN (option_menu)->child, &child_requisition);
|
|
|
|
|
|
|
|
requisition->width += child_requisition.width;
|
|
|
|
requisition->height += child_requisition.height;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
requisition->width = ((GTK_CONTAINER (widget)->border_width +
|
2001-12-04 03:27:30 +00:00
|
|
|
GTK_WIDGET (widget)->style->xthickness + props.focus_pad) * 2 +
|
2000-07-02 18:41:29 +00:00
|
|
|
MAX (child_requisition.width, option_menu->width) +
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
props.indicator_size.width +
|
|
|
|
props.indicator_spacing.left + props.indicator_spacing.right +
|
2001-12-04 03:27:30 +00:00
|
|
|
CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + props.focus_width * 2);
|
1997-11-24 22:37:52 +00:00
|
|
|
requisition->height = ((GTK_CONTAINER (widget)->border_width +
|
2001-12-04 03:27:30 +00:00
|
|
|
GTK_WIDGET (widget)->style->ythickness + props.focus_pad) * 2 +
|
2000-07-02 18:41:29 +00:00
|
|
|
MAX (child_requisition.height, option_menu->height) +
|
2001-12-04 03:27:30 +00:00
|
|
|
CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + props.focus_width * 2);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2002-01-17 01:37:31 +00:00
|
|
|
tmp = (requisition->height - MAX (child_requisition.height, option_menu->height) +
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
props.indicator_size.height + props.indicator_spacing.top + props.indicator_spacing.bottom);
|
1997-11-24 22:37:52 +00:00
|
|
|
requisition->height = MAX (requisition->height, tmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
|
|
|
GtkWidget *child;
|
2001-11-15 21:04:51 +00:00
|
|
|
GtkButton *button = GTK_BUTTON (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkAllocation child_allocation;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GtkOptionMenuProps props;
|
2001-05-31 19:11:16 +00:00
|
|
|
gint border_width;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
|
|
|
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
2001-05-31 19:11:16 +00:00
|
|
|
border_width = GTK_CONTAINER (widget)->border_width;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget->allocation = *allocation;
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
2001-11-15 21:04:51 +00:00
|
|
|
gdk_window_move_resize (button->event_window,
|
2001-05-31 19:11:16 +00:00
|
|
|
allocation->x + border_width, allocation->y + border_width,
|
|
|
|
allocation->width - border_width * 2, allocation->height - border_width * 2);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-07-07 01:25:27 +00:00
|
|
|
child = GTK_BIN (widget)->child;
|
1997-11-24 22:37:52 +00:00
|
|
|
if (child && GTK_WIDGET_VISIBLE (child))
|
|
|
|
{
|
2001-11-15 21:04:51 +00:00
|
|
|
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
|
2001-12-04 03:27:30 +00:00
|
|
|
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
|
2002-11-02 00:18:14 +00:00
|
|
|
|
2001-12-04 03:27:30 +00:00
|
|
|
child_allocation.x = widget->allocation.x + border_width + xthickness + props.focus_width + props.focus_pad + CHILD_LEFT_SPACING;
|
|
|
|
child_allocation.y = widget->allocation.y + border_width + ythickness + props.focus_width + props.focus_pad + CHILD_TOP_SPACING;
|
|
|
|
child_allocation.width = MAX (1, allocation->width - (border_width + xthickness + props.focus_width + props.focus_pad) * 2 -
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right -
|
2001-12-04 03:27:30 +00:00
|
|
|
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING);
|
|
|
|
child_allocation.height = MAX (1, allocation->height - (border_width + ythickness + props.focus_width + props.focus_pad) * 2 -
|
|
|
|
CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2002-11-02 00:18:14 +00:00
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL)
|
|
|
|
child_allocation.x += props.indicator_size.width + props.indicator_spacing.left + props.indicator_spacing.right;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_size_allocate (child, &child_allocation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_paint (GtkWidget *widget,
|
|
|
|
GdkRectangle *area)
|
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
GdkRectangle button_area;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
GtkOptionMenuProps props;
|
2001-05-31 19:11:16 +00:00
|
|
|
gint border_width;
|
2002-11-02 00:18:14 +00:00
|
|
|
gint tab_x;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
|
|
|
g_return_if_fail (area != NULL);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
2001-05-31 19:11:16 +00:00
|
|
|
border_width = GTK_CONTAINER (widget)->border_width;
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
button_area.x = widget->allocation.x + border_width;
|
|
|
|
button_area.y = widget->allocation.y + border_width;
|
2001-04-30 23:23:54 +00:00
|
|
|
button_area.width = widget->allocation.width - 2 * border_width;
|
|
|
|
button_area.height = widget->allocation.height - 2 * border_width;
|
|
|
|
|
2001-12-04 03:27:30 +00:00
|
|
|
if (!props.interior_focus && GTK_WIDGET_HAS_FOCUS (widget))
|
2001-04-30 23:23:54 +00:00
|
|
|
{
|
2001-12-04 03:27:30 +00:00
|
|
|
button_area.x += props.focus_width + props.focus_pad;
|
|
|
|
button_area.y += props.focus_width + props.focus_pad;
|
|
|
|
button_area.width -= 2 * (props.focus_width + props.focus_pad);
|
|
|
|
button_area.height -= 2 * (props.focus_width + props.focus_pad);
|
2001-04-30 23:23:54 +00:00
|
|
|
}
|
2001-12-04 03:27:30 +00:00
|
|
|
|
2001-07-12 17:50:14 +00:00
|
|
|
gtk_paint_box (widget->style, widget->window,
|
|
|
|
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
|
|
|
|
area, widget, "optionmenu",
|
|
|
|
button_area.x, button_area.y,
|
|
|
|
button_area.width, button_area.height);
|
1998-11-06 22:05:02 +00:00
|
|
|
|
2002-11-02 00:18:14 +00:00
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL)
|
2002-11-08 21:53:31 +00:00
|
|
|
tab_x = button_area.x + props.indicator_spacing.right +
|
2002-11-02 00:18:14 +00:00
|
|
|
widget->style->xthickness;
|
|
|
|
else
|
|
|
|
tab_x = button_area.x + button_area.width -
|
|
|
|
props.indicator_size.width - props.indicator_spacing.right -
|
|
|
|
widget->style->xthickness;
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_paint_tab (widget->style, widget->window,
|
|
|
|
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
|
|
|
|
area, widget, "optionmenutab",
|
2002-11-02 00:18:14 +00:00
|
|
|
tab_x,
|
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init): Fix
G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
stupidity.
Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com>
[ First pass at adding style properties. Still needs some definite
fine-tuning. ]
* gtk/gtkbutton.c: Add ::default_spacing style property.
* gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size,
::indicator_spacing style properties.
* gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing
style properties.
* gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property
rather than a normal property.
* gtk/gtkwidget.c: Add an ::interior_focus style property to
draw focus inside buttons, in the Windows/Java Metal/etc. style.
* gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c:
Honor ::interior_focus.
* gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is
TRUE.
* gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c:
Add ::slider_width, ::trough_border, ::stepper_size,
::stepper_spacing style properties.
* gtk/gtkscale.[ch] Add ::slider-length style property.
2001-04-02 15:51:28 +00:00
|
|
|
button_area.y + (button_area.height - props.indicator_size.height) / 2,
|
|
|
|
props.indicator_size.width, props.indicator_size.height);
|
1998-11-06 22:05:02 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (widget))
|
2001-04-30 23:23:54 +00:00
|
|
|
{
|
|
|
|
if (props.interior_focus)
|
|
|
|
{
|
2001-12-04 03:27:30 +00:00
|
|
|
button_area.x += widget->style->xthickness + props.focus_pad;
|
|
|
|
button_area.y += widget->style->ythickness + props.focus_pad;
|
|
|
|
button_area.width -= 2 * (widget->style->xthickness + props.focus_pad) +
|
|
|
|
props.indicator_spacing.left +
|
|
|
|
props.indicator_spacing.right +
|
|
|
|
props.indicator_size.width;
|
|
|
|
button_area.height -= 2 * (widget->style->ythickness + props.focus_pad);
|
2002-11-02 00:18:14 +00:00
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL)
|
|
|
|
button_area.x += props.indicator_spacing.left +
|
|
|
|
props.indicator_spacing.right +
|
|
|
|
props.indicator_size.width;
|
2001-04-30 23:23:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-12-04 03:27:30 +00:00
|
|
|
button_area.x -= props.focus_width + props.focus_pad;
|
|
|
|
button_area.y -= props.focus_width + props.focus_pad;
|
|
|
|
button_area.width += 2 * (props.focus_width + props.focus_pad);
|
|
|
|
button_area.height += 2 * (props.focus_width + props.focus_pad);
|
2001-04-30 23:23:54 +00:00
|
|
|
}
|
|
|
|
|
2001-12-04 03:27:30 +00:00
|
|
|
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
|
2001-04-30 23:23:54 +00:00
|
|
|
area, widget, "button",
|
|
|
|
button_area.x,
|
|
|
|
button_area.y,
|
2001-12-04 03:27:30 +00:00
|
|
|
button_area.width,
|
|
|
|
button_area.height);
|
2001-04-30 23:23:54 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_option_menu_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
|
|
|
gtk_option_menu_paint (widget, &event->area);
|
|
|
|
|
1998-06-13 01:36:28 +00:00
|
|
|
|
|
|
|
/* The following code tries to draw the child in two places at
|
|
|
|
* once. It fails miserably for several reasons
|
|
|
|
*
|
|
|
|
* - If the child is not no-window, removing generates
|
|
|
|
* more expose events. Bad, bad, bad.
|
|
|
|
*
|
|
|
|
* - Even if the child is no-window, removing it now (properly)
|
|
|
|
* clears the space where it was, so it does no good
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if 0
|
1997-11-24 22:37:52 +00:00
|
|
|
remove_child = FALSE;
|
|
|
|
child = GTK_BUTTON (widget)->child;
|
|
|
|
|
|
|
|
if (!child)
|
|
|
|
{
|
|
|
|
if (!GTK_OPTION_MENU (widget)->menu)
|
|
|
|
return FALSE;
|
|
|
|
gtk_option_menu_update_contents (GTK_OPTION_MENU (widget));
|
|
|
|
child = GTK_BUTTON (widget)->child;
|
|
|
|
if (!child)
|
|
|
|
return FALSE;
|
|
|
|
remove_child = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
child_event = *event;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_NO_WINDOW (child) &&
|
|
|
|
gtk_widget_intersect (child, &event->area, &child_event.area))
|
|
|
|
gtk_widget_event (child, (GdkEvent*) &child_event);
|
|
|
|
|
|
|
|
if (remove_child)
|
|
|
|
gtk_option_menu_remove_contents (GTK_OPTION_MENU (widget));
|
1998-06-13 01:36:28 +00:00
|
|
|
#else
|
2001-03-09 13:28:26 +00:00
|
|
|
if (GTK_BIN (widget)->child)
|
|
|
|
gtk_container_propagate_expose (GTK_CONTAINER (widget),
|
|
|
|
GTK_BIN (widget)->child,
|
|
|
|
event);
|
1998-06-13 01:36:28 +00:00
|
|
|
#endif /* 0 */
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_option_menu_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu;
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
GtkWidget *menu_item;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
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
|
|
|
option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if ((event->type == GDK_BUTTON_PRESS) &&
|
|
|
|
(event->button == 1))
|
|
|
|
{
|
|
|
|
gtk_option_menu_remove_contents (option_menu);
|
|
|
|
gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL,
|
|
|
|
gtk_option_menu_position, option_menu,
|
|
|
|
event->button, event->time);
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
|
|
|
if (menu_item)
|
|
|
|
gtk_menu_shell_select_item (GTK_MENU_SHELL (option_menu->menu), menu_item);
|
1998-12-22 20:55:30 +00:00
|
|
|
return TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
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 gint
|
|
|
|
gtk_option_menu_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu;
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
GtkWidget *menu_item;
|
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
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
|
|
|
|
switch (event->keyval)
|
|
|
|
{
|
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
|
|
|
case GDK_KP_Space:
|
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
|
|
|
case GDK_space:
|
|
|
|
gtk_option_menu_remove_contents (option_menu);
|
|
|
|
gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL,
|
|
|
|
gtk_option_menu_position, option_menu,
|
|
|
|
0, event->time);
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
|
|
|
if (menu_item)
|
|
|
|
gtk_menu_shell_select_item (GTK_MENU_SHELL (option_menu->menu), menu_item);
|
1998-12-22 20:55:30 +00:00
|
|
|
return TRUE;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
2001-08-17 16:33:04 +00:00
|
|
|
gtk_option_menu_selection_done (GtkMenuShell *menu_shell,
|
|
|
|
GtkOptionMenu *option_menu)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (menu_shell != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
|
|
|
gtk_option_menu_update_contents (option_menu);
|
|
|
|
}
|
|
|
|
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_changed (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
2002-10-09 23:55:27 +00:00
|
|
|
g_signal_emit (option_menu, signals[CHANGED], 0);
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
}
|
|
|
|
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_select_first_sensitive (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
if (option_menu->menu)
|
|
|
|
{
|
|
|
|
GList *children = GTK_MENU_SHELL (option_menu->menu)->children;
|
|
|
|
gint index = 0;
|
|
|
|
|
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_SENSITIVE (children->data))
|
|
|
|
{
|
|
|
|
gtk_option_menu_set_history (option_menu, index);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
children = children->next;
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_item_state_changed_cb (GtkWidget *widget,
|
|
|
|
GtkStateType previous_state,
|
|
|
|
GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
GtkWidget *child = GTK_BIN (option_menu)->child;
|
|
|
|
|
|
|
|
if (child && GTK_WIDGET_SENSITIVE (child) != GTK_WIDGET_IS_SENSITIVE (widget))
|
|
|
|
gtk_widget_set_sensitive (child, GTK_WIDGET_IS_SENSITIVE (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_item_destroy_cb (GtkWidget *widget,
|
|
|
|
GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
GtkWidget *child = GTK_BIN (option_menu)->child;
|
|
|
|
|
|
|
|
if (child)
|
|
|
|
{
|
2002-10-09 23:55:27 +00:00
|
|
|
g_object_ref (child);
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
gtk_option_menu_remove_contents (option_menu);
|
|
|
|
gtk_widget_destroy (child);
|
2002-10-09 23:55:27 +00:00
|
|
|
g_object_unref (child);
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
|
|
|
|
gtk_option_menu_select_first_sensitive (option_menu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_option_menu_update_contents (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
GtkWidget *child;
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
|
|
|
if (option_menu->menu)
|
|
|
|
{
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
GtkWidget *old_item = option_menu->menu_item;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_option_menu_remove_contents (option_menu);
|
|
|
|
|
|
|
|
option_menu->menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
|
|
|
if (option_menu->menu_item)
|
|
|
|
{
|
2002-10-09 23:55:27 +00:00
|
|
|
g_object_ref (option_menu->menu_item);
|
1997-11-24 22:37:52 +00:00
|
|
|
child = GTK_BIN (option_menu->menu_item)->child;
|
|
|
|
if (child)
|
|
|
|
{
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
if (!GTK_WIDGET_IS_SENSITIVE (option_menu->menu_item))
|
|
|
|
gtk_widget_set_sensitive (child, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_reparent (child, GTK_WIDGET (option_menu));
|
|
|
|
}
|
|
|
|
|
2002-10-09 23:55:27 +00:00
|
|
|
g_signal_connect (option_menu->menu_item, "state_changed",
|
|
|
|
G_CALLBACK (gtk_option_menu_item_state_changed_cb), option_menu);
|
|
|
|
g_signal_connect (option_menu->menu_item, "destroy",
|
|
|
|
G_CALLBACK (gtk_option_menu_item_destroy_cb), option_menu);
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
|
1999-02-10 02:35:09 +00:00
|
|
|
gtk_widget_size_request (child, &child_requisition);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_size_allocate (GTK_WIDGET (option_menu),
|
|
|
|
&(GTK_WIDGET (option_menu)->allocation));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (option_menu))
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (option_menu));
|
|
|
|
}
|
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
2001-01-04 17:48:43 +00:00
|
|
|
|
|
|
|
if (old_item != option_menu->menu_item)
|
|
|
|
gtk_option_menu_changed (option_menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_remove_contents (GtkOptionMenu *option_menu)
|
|
|
|
{
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
GtkWidget *child;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
if (option_menu->menu_item)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
child = GTK_BIN (option_menu)->child;
|
|
|
|
|
|
|
|
if (child)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (child, TRUE);
|
2003-03-29 00:48:28 +00:00
|
|
|
gtk_widget_set_state (child, GTK_STATE_NORMAL);
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
gtk_widget_reparent (child, option_menu->menu_item);
|
|
|
|
}
|
|
|
|
|
2002-10-09 23:55:27 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (option_menu->menu_item,
|
|
|
|
gtk_option_menu_item_state_changed_cb,
|
|
|
|
option_menu);
|
|
|
|
g_signal_handlers_disconnect_by_func (option_menu->menu_item,
|
|
|
|
gtk_option_menu_item_destroy_cb,
|
|
|
|
option_menu);
|
Get rid of a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
Fri Feb 2 12:26:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Get rid of
a bunch of g_strdup_printf("%s%s") in favor of g_strconcat().
* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
since some people set $(libdir) separately. (#1290, David Kaelbling)
Thu Feb 1 18:25:46 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
MAXPATHLEN, but the code here depends on a fixed value.)
(#4524)
Wed Jan 31 22:01:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
where child == NULL and handle_position == RIGHT or BOTTOM. (#8041g)
Wed Jan 31 21:20:39 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
viewable there is no way that moving the node will cause the
focus row to become not viewable, so omit check on the visibility
of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
Wed Jan 31 20:38:17 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_commit_cb): Delete the current
selection before inserting new text.
Wed Jan 31 18:49:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
Make the sensitivity of the reparented child track that of
the original parent menu item. (#34218, David Hodson)
* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
the case where the current item is destroyed properly.
* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
some edge cases with child-less menuitems.
Wed Jan 31 17:16:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 16:21:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
toggling of rows off in BROWSE or EXTENDED mode. (#12072, Jon K Hellan)
The solution here isn't perfect - you get an extraneous
emission of "toggle", which could conceivably confuse an app,
but better than the current situation. LXR search seems to
indicate that no apps in GNOME CVS connect to "toggle".
Wed Jan 31 15:46:13 2001 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkcompat.h from
gtk_public_h_sources to directly here to avoid warning when
building srcdir != builddir. (#9656)
Tue Jan 30 19:49:02 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
handlers in gtkrange.c return the proper values (TRUE == handled)
(#10316).
This is just the tip of the iceberg, but gtkrange.c is the
most common place where the propagation is problematical,
and also a place where it is almost certainly safe to change
this in the stable branch.
(You don't want right click popups on a range control or anything...)
Tue Jan 30 18:57:59 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_focus_area): We need to clear the focus
area on focus out, even if a background pixmap isn't set.
(#13941)
Tue Jan 30 18:24:10 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
to deal with setting the shape properly when scrolling arrows are
turned on, but not visible because there is sufficient space.
(#13432)
Tue Jan 30 16:39:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
items with submenus, destroy the item along with the submenu.
(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
properly.
* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
later.
Tue Jan 30 15:51:25 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
the focus widget sometimes wasn't drawn with the default if there
was no default widget.
* gtk/gtkstyle.c (gtk_style_real_unrealize): free colors,
unreference pixmaps.
* gtk/gtkstyle.c (gtk_style_realize): Reference colormap
for some extra safety.
Mon Jan 29 19:00:01 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
the text of a cell to the old pointer value better, by
copying the new text before freeing the old text. Some code
cleanup. (#8079, Karl Nelson)
Mon Jan 29 16:50:19 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.[ch] gtk/gtkframe.[ch]: Make gtk_label_get_text()
gtk_frame_get_label() non strdup'ing, and G_CONST_RETURN.
Mon Jan 29 15:22:51 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_remove): When removing an
item from a menu, check to see if it matches
menu->old_active_menu_item, and if so, unref and clear
old_active_menu_item (Patch from Pavel Cisler)
* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
menu_shell->active_menu_item, if it is the child being
removed. (Patch based on that of Gene Ragan, #50337)
2001-02-02 17:53:29 +00:00
|
|
|
|
2002-10-09 23:55:27 +00:00
|
|
|
g_object_unref (option_menu->menu_item);
|
1997-11-24 22:37:52 +00:00
|
|
|
option_menu->menu_item = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
|
|
|
|
{
|
|
|
|
GtkWidget *child;
|
|
|
|
GList *children;
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
2000-07-02 18:41:29 +00:00
|
|
|
gint old_width = option_menu->width;
|
|
|
|
gint old_height = option_menu->height;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
|
|
|
|
|
|
|
|
option_menu->width = 0;
|
|
|
|
option_menu->height = 0;
|
|
|
|
|
|
|
|
if (option_menu->menu)
|
|
|
|
{
|
|
|
|
children = GTK_MENU_SHELL (option_menu->menu)->children;
|
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (child))
|
|
|
|
{
|
2001-11-26 00:19:31 +00:00
|
|
|
GtkWidget *inner = GTK_BIN (child)->child;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-11-26 00:19:31 +00:00
|
|
|
if (inner)
|
|
|
|
{
|
|
|
|
gtk_widget_size_request (inner, &child_requisition);
|
|
|
|
|
|
|
|
option_menu->width = MAX (option_menu->width, child_requisition.width);
|
|
|
|
option_menu->height = MAX (option_menu->height, child_requisition.height);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-07-02 18:41:29 +00:00
|
|
|
|
|
|
|
if (old_width != option_menu->width || old_height != option_menu->height)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (option_menu));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_position (GtkMenu *menu,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
gboolean *push_in,
|
1997-11-24 22:37:52 +00:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu;
|
|
|
|
GtkWidget *active;
|
|
|
|
GtkWidget *child;
|
2001-11-15 21:04:51 +00:00
|
|
|
GtkWidget *widget;
|
2000-03-14 19:57:25 +00:00
|
|
|
GtkRequisition requisition;
|
1997-11-24 22:37:52 +00:00
|
|
|
GList *children;
|
|
|
|
gint screen_width;
|
|
|
|
gint menu_xpos;
|
|
|
|
gint menu_ypos;
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
gint menu_width;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (user_data));
|
|
|
|
|
|
|
|
option_menu = GTK_OPTION_MENU (user_data);
|
2001-11-15 21:04:51 +00:00
|
|
|
widget = GTK_WIDGET (option_menu);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-03-14 19:57:25 +00:00
|
|
|
gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
menu_width = requisition.width;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
active = gtk_menu_get_active (GTK_MENU (option_menu->menu));
|
2001-11-15 21:04:51 +00:00
|
|
|
gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-11-15 21:04:51 +00:00
|
|
|
menu_xpos += widget->allocation.x;
|
|
|
|
menu_ypos += widget->allocation.y + widget->allocation.height / 2 - 2;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (active != NULL)
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
|
|
|
gtk_widget_get_child_requisition (active, &requisition);
|
|
|
|
menu_ypos -= requisition.height / 2;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
children = GTK_MENU_SHELL (option_menu->menu)->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
|
|
|
|
if (active == child)
|
|
|
|
break;
|
|
|
|
|
1998-11-01 21:10:44 +00:00
|
|
|
if (GTK_WIDGET_VISIBLE (child))
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
|
|
|
gtk_widget_get_child_requisition (child, &requisition);
|
|
|
|
menu_ypos -= requisition.height;
|
|
|
|
}
|
1998-11-01 21:10:44 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
children = children->next;
|
|
|
|
}
|
|
|
|
|
2003-02-26 19:36:34 +00:00
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
|
|
|
menu_xpos = menu_xpos + widget->allocation.width - menu_width;
|
|
|
|
|
|
|
|
/* Clamp the position on screen */
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (menu_xpos < 0)
|
|
|
|
menu_xpos = 0;
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
else if ((menu_xpos + menu_width) > screen_width)
|
|
|
|
menu_xpos -= ((menu_xpos + menu_width) - screen_width);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
*x = menu_xpos;
|
|
|
|
*y = menu_ypos;
|
Add note about GtkMenuPositionFunc API changes.
2000-11-08 Alexander Larsson <alexl@redhat.com>
* docs/Changes-2.0.txt: Add note about GtkMenuPositionFunc
API changes.
* gtk/gtkmenu.c: Add support for scrolling menus.
Remove gtk_menu_append/prepend/insert, these have been moved to
gtkcompat.h as #defines.
* gtk/gtkcompat.h.in:
Add compatibility #defines for gtk_menu_append/prepend/insert
* gtk/gtkmenu.h: Add data needed for scrolling menus.
GtkMenuPositionFunc gets an extra argument push_in.
gtk_menu_append/prepend/insert removed.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Change menu
positioning behaviour to fit to scrolling menus.
* gtk/gtkmenuitem.c (gtk_menu_item_forall): Don't recurse
into menuitem->submeny. That is wrong, and broke torn
off submenus of torn off menus, since they were unrealized
when the first menu was unrealized.
* gtk/gtkmenushell.[ch]: Virtualize gtk_menu_shell_insert() and
gtk_menu_shell_select_item() since these need to be overridden in
GtkMenu.
* gtk/gtkoptionmenu.c (gtk_opttion_menu_position): Change menu
positioning behaviour to fit to scrolling menus.
(gtk_option_menu_key_press, gtk_option_menu_button_press): Select
the current item so that it is prelighted when the menu pops up.
This is a workaround to the fact that the menu doesn't get the
initial enter event (due to grabs).
* gtk/gtkfilesel.c, gtk/gtkinputdialog.c, gtk/testgtk.c:
s/gtk_menu_append/gtk_menu_shell_append/
* gtk/gtknotebook.c:
s/gtk_menu_insert/gtk_menu_shell_insert/
* gtk/testgtk.c (create_menu, create_menus):
Create the first menu with 50 items so that menu scrolling
can be tested.
Patch from Jonathan Blandford <jrb@redhat.com>
* gtk/gtkmenuitem.[ch] (gtk_menu_item_toggle_size_request): new
system to handle size requests. First, we ask what the size of
the toggle is. Then, when allocating the size, we allocate the
toggle_size first. This way we can have multiple menu-item
classes w/o needing a seperate class for each.
* gtk/gtkmenu.c (gtk_menu_size_request): Actually use the new system.
* gtk/gtkmenu.c (gtk_menu_size_allocate): Use the new system.
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): New function to handle
the toggle size-request.
2000-11-08 17:34:52 +00:00
|
|
|
*push_in = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-02 20:22:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_show_all (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkContainer *container;
|
|
|
|
GtkOptionMenu *option_menu;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
|
|
|
container = GTK_CONTAINER (widget);
|
|
|
|
option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
gtk_container_foreach (container, (GtkCallback) gtk_widget_show_all, NULL);
|
|
|
|
if (option_menu->menu)
|
|
|
|
gtk_widget_show_all (option_menu->menu);
|
|
|
|
if (option_menu->menu_item)
|
|
|
|
gtk_widget_show_all (option_menu->menu_item);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_option_menu_hide_all (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkContainer *container;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
|
|
|
container = GTK_CONTAINER (widget);
|
|
|
|
|
|
|
|
gtk_widget_hide (widget);
|
|
|
|
gtk_container_foreach (container, (GtkCallback) gtk_widget_hide_all, NULL);
|
|
|
|
}
|
|
|
|
|
2001-10-16 19:45:34 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_option_menu_mnemonic_activate (GtkWidget *widget,
|
|
|
|
gboolean group_cycling)
|
|
|
|
{
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-09-17 02:19:01 +00:00
|
|
|
static gint
|
|
|
|
gtk_option_menu_scroll_event (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event)
|
|
|
|
{
|
|
|
|
GtkOptionMenu *option_menu = GTK_OPTION_MENU (widget);
|
|
|
|
gint index;
|
|
|
|
gint n_children;
|
|
|
|
gint index_dir;
|
|
|
|
GList *l;
|
|
|
|
GtkMenuItem *item;
|
|
|
|
|
|
|
|
index = gtk_option_menu_get_history (option_menu);
|
|
|
|
|
|
|
|
if (index != -1)
|
|
|
|
{
|
|
|
|
n_children = g_list_length (GTK_MENU_SHELL (option_menu->menu)->children);
|
|
|
|
|
|
|
|
if (event->direction == GDK_SCROLL_UP)
|
|
|
|
index_dir = -1;
|
|
|
|
else
|
|
|
|
index_dir = 1;
|
|
|
|
|
|
|
|
|
|
|
|
while (TRUE)
|
|
|
|
{
|
|
|
|
index += index_dir;
|
|
|
|
|
|
|
|
if (index < 0)
|
|
|
|
break;
|
|
|
|
if (index >= n_children)
|
|
|
|
break;
|
|
|
|
|
|
|
|
l = g_list_nth (GTK_MENU_SHELL (option_menu->menu)->children, index);
|
|
|
|
item = GTK_MENU_ITEM (l->data);
|
|
|
|
if (GTK_WIDGET_VISIBLE (item) && GTK_WIDGET_IS_SENSITIVE (item))
|
|
|
|
{
|
|
|
|
gtk_option_menu_set_history (option_menu, index);
|
2002-07-10 18:47:32 +00:00
|
|
|
gtk_menu_item_activate (GTK_MENU_ITEM (item));
|
2001-09-17 02:19:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
#define __GTK_OPTION_MENU_C__
|
|
|
|
#include "gtkaliasdef.c"
|
|
|
|
|