comparison src/gtkutil.c @ 78538:2fcf45c12927

(update_frame_tool_bar): Use -1 as index to gtk_toolbar_insert.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 13 Aug 2007 06:36:31 +0000
parents 922696f363b0
children 4eb8619e3abd
comparison
equal deleted inserted replaced
78537:4164b3c91734 78538:2fcf45c12927
3370 3370
3371 idx *= TOOL_BAR_ITEM_NSLOTS; 3371 idx *= TOOL_BAR_ITEM_NSLOTS;
3372 3372
3373 key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY); 3373 key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY);
3374 XSETFRAME (frame, f); 3374 XSETFRAME (frame, f);
3375
3376 /* We generate two events here. The first one is to set the prefix
3377 to `(tool_bar)', see keyboard.c. */
3375 event.kind = TOOL_BAR_EVENT; 3378 event.kind = TOOL_BAR_EVENT;
3376 event.frame_or_window = frame; 3379 event.frame_or_window = frame;
3377 event.arg = frame; 3380 event.arg = frame;
3378 kbd_buffer_store_event (&event); 3381 kbd_buffer_store_event (&event);
3379 3382
3380 event.kind = TOOL_BAR_EVENT; 3383 event.kind = TOOL_BAR_EVENT;
3381 event.frame_or_window = frame; 3384 event.frame_or_window = frame;
3382 event.arg = key; 3385 event.arg = key;
3383 /* Convert between the modifier bits GDK uses and the modifier bits 3386 /* Convert between the modifier bits GDK uses and the modifier bits
3384 Emacs uses. This assumes GDK an X masks are the same, which they are when 3387 Emacs uses. This assumes GDK an X masks are the same, which they are when
3385 this is written. */ 3388 this is written. */
3797 gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE); 3800 gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE);
3798 gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE); 3801 gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE);
3799 gtk_container_add (GTK_CONTAINER (weventbox), wbutton); 3802 gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
3800 ti = gtk_tool_item_new (); 3803 ti = gtk_tool_item_new ();
3801 gtk_container_add (GTK_CONTAINER (ti), weventbox); 3804 gtk_container_add (GTK_CONTAINER (ti), weventbox);
3802 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); 3805 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
3803 } 3806 }
3804 continue; 3807 continue;
3805 } 3808 }
3806 3809
3807 if (ti == NULL) 3810 if (ti == NULL)
3814 gtk_container_add (GTK_CONTAINER (wbutton), w); 3817 gtk_container_add (GTK_CONTAINER (wbutton), w);
3815 weventbox = gtk_event_box_new (); 3818 weventbox = gtk_event_box_new ();
3816 gtk_container_add (GTK_CONTAINER (weventbox), wbutton); 3819 gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
3817 ti = gtk_tool_item_new (); 3820 ti = gtk_tool_item_new ();
3818 gtk_container_add (GTK_CONTAINER (ti), weventbox); 3821 gtk_container_add (GTK_CONTAINER (ti), weventbox);
3819 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); 3822 gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
3820 3823
3821 3824
3822 /* The EMACS_INT cast avoids a warning. */ 3825 /* The EMACS_INT cast avoids a warning. */
3823 g_signal_connect (G_OBJECT (ti), "create-menu-proxy", 3826 g_signal_connect (G_OBJECT (ti), "create-menu-proxy",
3824 GTK_SIGNAL_FUNC (xg_tool_bar_menu_proxy), 3827 GTK_SIGNAL_FUNC (xg_tool_bar_menu_proxy),