diff options
| author | Jan Djärv | 2009-07-01 15:52:58 +0000 |
|---|---|---|
| committer | Jan Djärv | 2009-07-01 15:52:58 +0000 |
| commit | 69b166106d00cb312a0013c7a026fd60c228f6e4 (patch) | |
| tree | ca62e50d2af28763e964fedf434b3f77b1c9cb15 /src | |
| parent | 99278f8a619664e55e814e6a5c5b6d3898b61214 (diff) | |
| download | emacs-69b166106d00cb312a0013c7a026fd60c228f6e4.tar.gz emacs-69b166106d00cb312a0013c7a026fd60c228f6e4.zip | |
* gtkutil.c (xg_tool_bar_proxy_help_callback): New function.
(xg_tool_bar_menu_proxy): Attach enter/leave events to
xg_tool_bar_proxy_help_callback.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/gtkutil.c | 43 |
2 files changed, 43 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9108cd39cc6..481b6e8c88d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * gtkutil.c (xg_tool_bar_proxy_help_callback): New function. | ||
| 4 | (xg_tool_bar_menu_proxy): Attach enter/leave events to | ||
| 5 | xg_tool_bar_proxy_help_callback. | ||
| 6 | |||
| 3 | * emacs.c (USAGE3, standard_args): Add -mm and --maximized. | 7 | * emacs.c (USAGE3, standard_args): Add -mm and --maximized. |
| 4 | 8 | ||
| 5 | * frame.c: Qmaximized is new. | 9 | * frame.c: Qmaximized is new. |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 1872aa74d39..9a11605a417 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -3459,10 +3459,30 @@ xg_tool_bar_proxy_callback (w, client_data) | |||
| 3459 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | 3459 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), |
| 3460 | XG_TOOL_BAR_PROXY_BUTTON)); | 3460 | XG_TOOL_BAR_PROXY_BUTTON)); |
| 3461 | xg_tool_bar_callback (wbutton, client_data); | 3461 | xg_tool_bar_callback (wbutton, client_data); |
| 3462 | FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (wbutton), | ||
| 3463 | XG_FRAME_DATA); | ||
| 3464 | } | 3462 | } |
| 3465 | 3463 | ||
| 3464 | |||
| 3465 | static gboolean | ||
| 3466 | xg_tool_bar_help_callback P_ ((GtkWidget *w, | ||
| 3467 | GdkEventCrossing *event, | ||
| 3468 | gpointer client_data)); | ||
| 3469 | |||
| 3470 | /* This callback is called when a help is to be shown for an item in | ||
| 3471 | the detached tool bar when the detached tool bar it is not expanded. */ | ||
| 3472 | |||
| 3473 | static gboolean | ||
| 3474 | xg_tool_bar_proxy_help_callback (w, event, client_data) | ||
| 3475 | GtkWidget *w; | ||
| 3476 | GdkEventCrossing *event; | ||
| 3477 | gpointer client_data; | ||
| 3478 | { | ||
| 3479 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | ||
| 3480 | XG_TOOL_BAR_PROXY_BUTTON)); | ||
| 3481 | |||
| 3482 | xg_tool_bar_help_callback (wbutton, event, client_data); | ||
| 3483 | } | ||
| 3484 | |||
| 3485 | |||
| 3466 | /* This callback is called when a tool item should create a proxy item, | 3486 | /* This callback is called when a tool item should create a proxy item, |
| 3467 | such as for the overflow menu. Also called when the tool bar is detached. | 3487 | such as for the overflow menu. Also called when the tool bar is detached. |
| 3468 | If we don't create a proxy menu item, the detached tool bar will be | 3488 | If we don't create a proxy menu item, the detached tool bar will be |
| @@ -3475,7 +3495,7 @@ xg_tool_bar_menu_proxy (toolitem, user_data) | |||
| 3475 | { | 3495 | { |
| 3476 | GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); | 3496 | GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); |
| 3477 | GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); | 3497 | GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); |
| 3478 | GtkWidget *wmenuitem = gtk_image_menu_item_new (); | 3498 | GtkWidget *wmenuitem = gtk_image_menu_item_new_with_label (""); |
| 3479 | GtkWidget *wmenuimage; | 3499 | GtkWidget *wmenuimage; |
| 3480 | 3500 | ||
| 3481 | if (gtk_button_get_use_stock (wbutton)) | 3501 | if (gtk_button_get_use_stock (wbutton)) |
| @@ -3545,9 +3565,24 @@ xg_tool_bar_menu_proxy (toolitem, user_data) | |||
| 3545 | G_CALLBACK (xg_tool_bar_proxy_callback), | 3565 | G_CALLBACK (xg_tool_bar_proxy_callback), |
| 3546 | user_data); | 3566 | user_data); |
| 3547 | 3567 | ||
| 3568 | |||
| 3548 | g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, | 3569 | g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, |
| 3549 | (gpointer) wbutton); | 3570 | (gpointer) wbutton); |
| 3550 | gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); | 3571 | gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); |
| 3572 | gtk_widget_set_sensitive (wmenuitem, GTK_WIDGET_SENSITIVE (wbutton)); | ||
| 3573 | |||
| 3574 | /* Use enter/leave notify to show help. We use the events | ||
| 3575 | rather than the GtkButton specific signals "enter" and | ||
| 3576 | "leave", so we can have only one callback. The event | ||
| 3577 | will tell us what kind of event it is. */ | ||
| 3578 | g_signal_connect (G_OBJECT (wmenuitem), | ||
| 3579 | "enter-notify-event", | ||
| 3580 | G_CALLBACK (xg_tool_bar_proxy_help_callback), | ||
| 3581 | user_data); | ||
| 3582 | g_signal_connect (G_OBJECT (wmenuitem), | ||
| 3583 | "leave-notify-event", | ||
| 3584 | G_CALLBACK (xg_tool_bar_proxy_help_callback), | ||
| 3585 | user_data); | ||
| 3551 | 3586 | ||
| 3552 | return TRUE; | 3587 | return TRUE; |
| 3553 | } | 3588 | } |
| @@ -4016,7 +4051,7 @@ update_frame_tool_bar (f) | |||
| 4016 | NULL); | 4051 | NULL); |
| 4017 | 4052 | ||
| 4018 | g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f); | 4053 | g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f); |
| 4019 | 4054 | ||
| 4020 | /* Use enter/leave notify to show help. We use the events | 4055 | /* Use enter/leave notify to show help. We use the events |
| 4021 | rather than the GtkButton specific signals "enter" and | 4056 | rather than the GtkButton specific signals "enter" and |
| 4022 | "leave", so we can have only one callback. The event | 4057 | "leave", so we can have only one callback. The event |