diff options
author | Tim Janik <timj@gtk.org> | 1998-06-18 03:22:09 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-06-18 03:22:09 +0000 |
commit | f83d57e91b6ffa2377d714f076343ac9e71b78c1 (patch) | |
tree | ae7428e1a0be53d24c94a645f01ca32eaecacfdc /gtk/gtksignal.c | |
parent | 85adae970a84eaf5cb5d3ce8819044cb832e0d72 (diff) | |
download | gtk+-f83d57e91b6ffa2377d714f076343ac9e71b78c1.tar.gz |
yeppers, accelerator changes to fix the gimp. commit message dedicated to
yeppers, accelerator changes to fix the gimp.
commit message dedicated to sopwith ;)
Thu Jun 18 03:30:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new function gtk_accel_label_accelerator_width to
request the size of the accelerator portion of an accel label.
(gtk_accel_label_size_request): don't request for the accelerators size.
(gtk_accel_label_expose_event): only draw the accelerator if we got
enough extra space.
* gtk/gtkmenuitem.c (gtk_menu_item_size_request): request accelerator
width from children.
* gtk/gtkmenu.c (gtk_menu_key_press): when adding an accelerator to an
object (after removal has been requested) check if there is still an
accelerator remaining to avoid adding two accelerators on an object.
this can happen for locked accelerators (or accelerator-frozen widgets).
(gtk_menu_size_request): feature childrens accelerator width in size
requests.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): use
gtk_widget_freeze_accelerators() for dynamically created menu items.
* gtk/gtksignal.h:
* gtk/gtksignal.c: new function gtk_signal_handler_pending_by_func()
which will return a handler_id > 0 if the specified function is pending
for `signal_id'.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: remove gtk_widget_stop_accelerator, which was just
a signal handler function to stop accelerator addition.
added gtk_widget_freeze_accelerators and gtk_widget_thaw_accelerators
which will prevent (undo) any accelerators from being added to or
removed from a widget.
Diffstat (limited to 'gtk/gtksignal.c')
-rw-r--r-- | gtk/gtksignal.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/gtk/gtksignal.c b/gtk/gtksignal.c index 45330e84f1..edd7858e05 100644 --- a/gtk/gtksignal.c +++ b/gtk/gtksignal.c @@ -1501,7 +1501,44 @@ gtk_signal_handler_pending (GtkObject *object, while (handlers && handlers->signal_id == signal_id) { if (handlers->id > 0 && - (may_be_blocked || handlers->blocked == 0)) + (may_be_blocked || handlers->blocked == FALSE)) + { + handler_id = handlers->id; + break; + } + + handlers = handlers->next; + } + + return handler_id; +} + +guint +gtk_signal_handler_pending_by_func (GtkObject *object, + guint signal_id, + gboolean may_be_blocked, + GtkSignalFunc func, + gpointer data) +{ + GtkHandler *handlers; + guint handler_id; + + g_return_val_if_fail (object != NULL, 0); + g_return_val_if_fail (func != NULL, 0); + g_return_val_if_fail (signal_id >= 1, 0); + + if (GTK_OBJECT_CONNECTED (object)) + handlers = gtk_signal_get_handlers (object, signal_id); + else + return 0; + + handler_id = 0; + while (handlers && handlers->signal_id == signal_id) + { + if (handlers->id > 0 && + handlers->func == func && + handlers->func_data == data && + (may_be_blocked || handlers->blocked == FALSE)) { handler_id = handlers->id; break; |