+ tool->m_item = gtk_toolbar_insert_element
+ (
+ m_toolbar,
+ tool->GetGtkChildType(),
+ widget,
+ tool->GetLabel().empty()
+ ? NULL
+ : (const char*) wxGTK_CONV( tool->GetLabel() ),
+ tool->GetShortHelp().empty()
+ ? NULL
+ : (const char*) wxGTK_CONV( tool->GetShortHelp() ),
+ "", // tooltip_private_text (?)
+ tool->m_image,
+ (GtkSignalFunc)gtk_toolbar_callback,
+ (gpointer)tool,
+ posGtk
+ );
+
+ wxCHECK_MSG(tool->m_item != NULL, false, _T("gtk_toolbar_insert_element() failed"));
+
+ g_signal_connect (tool->m_item, "enter_notify_event",
+ G_CALLBACK (gtk_toolbar_tool_callback),
+ tool);
+ g_signal_connect (tool->m_item, "leave_notify_event",
+ G_CALLBACK (gtk_toolbar_tool_callback),
+ tool);
+ g_signal_connect(tool->m_item, "button-press-event",
+ G_CALLBACK (gtk_toolbar_tool_rclick_callback),
+ tool);
+
+ if (tool->GetKind() == wxITEM_DROPDOWN)
+ {
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data( arrow_down_xpm );
+ GtkWidget *dropdown = gtk_toggle_button_new();
+ GtkWidget *image = gtk_image_new_from_pixbuf( pixbuf );
+ gtk_widget_show( image );
+ gtk_container_add( GTK_CONTAINER(dropdown), image );
+
+ if (GetWindowStyle() & wxTB_FLAT)
+ gtk_button_set_relief( GTK_BUTTON(dropdown), GTK_RELIEF_NONE );
+ GTK_WIDGET_UNSET_FLAGS (dropdown, GTK_CAN_FOCUS);
+ gtk_widget_show( dropdown );
+
+ g_signal_connect (dropdown, "enter_notify_event",
+ G_CALLBACK (gtk_toolbar_buddy_enter_callback),
+ tool->m_item);
+ g_signal_connect (dropdown, "leave_notify_event",
+ G_CALLBACK (gtk_toolbar_buddy_leave_callback),
+ tool->m_item);
+ g_signal_connect(dropdown, "button-press-event",
+ G_CALLBACK (gtk_toolbar_dropdown_lclick_callback),
+ tool);
+
+ GtkRequisition req;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(tool->m_item) )->size_request )
+ (tool->m_item, &req );
+ gtk_widget_set_size_request( dropdown, -1, req.height );
+
+ gtk_toolbar_insert_widget(m_toolbar, dropdown, NULL, NULL,
+ posGtk + 1);
+ }
+ }