+ tool->SetImage(tool->GetBitmap());
+ }
+}
+}
+
+//-----------------------------------------------------------------------------
+// "right-click"
+//-----------------------------------------------------------------------------
+extern "C" {
+static gboolean gtk_toolbar_tool_rclick_callback(GtkWidget *WXUNUSED(widget),
+ GdkEventButton *event,
+ wxToolBarToolBase *tool)
+{
+ if (event->button != 3)
+ return FALSE;
+
+ wxToolBar *tbar = (wxToolBar *)tool->GetToolBar();
+
+ if (tbar->m_blockEvent) return TRUE;
+
+ if (g_blockEventsOnDrag) return TRUE;
+ if (!tool->IsEnabled()) return TRUE;
+
+ tbar->OnRightClick( tool->GetId(), (int)event->x, (int)event->y );
+
+ return TRUE;
+}
+}
+
+//-----------------------------------------------------------------------------
+// "enter_notify_event" / "leave_notify_event" from dropdown
+//-----------------------------------------------------------------------------
+
+extern "C" {
+static gint gtk_toolbar_buddy_enter_callback( GtkWidget *WXUNUSED(widget),
+ GdkEventCrossing *WXUNUSED(gdk_event),
+ GtkWidget *tool )
+{
+ guint8 state = GTK_WIDGET_STATE( tool );
+ state |= GTK_STATE_PRELIGHT;
+ gtk_widget_set_state( tool, (GtkStateType) state );
+ return FALSE;
+}
+
+static gint gtk_toolbar_buddy_leave_callback( GtkWidget *WXUNUSED(widget),
+ GdkEventCrossing *WXUNUSED(gdk_event),
+ GtkWidget *tool )
+{
+ guint8 state = GTK_WIDGET_STATE( tool );
+ state &= ~GTK_STATE_PRELIGHT;
+ gtk_widget_set_state( tool, (GtkStateType) state );
+ return FALSE;
+}
+}
+
+//-----------------------------------------------------------------------------
+// "left-click" on dropdown
+//-----------------------------------------------------------------------------
+
+extern "C"
+{
+static void gtk_pop_tb_hide_callback( GtkWidget *WXUNUSED(menu), GtkToggleButton *button )
+{
+ gtk_toggle_button_set_active( button, FALSE );
+}
+
+static gboolean gtk_toolbar_dropdown_lclick_callback(GtkWidget *widget,
+ GdkEventButton *event,
+ wxToolBarToolBase *tool)
+{
+ if (event->button != 1)
+ return FALSE;
+
+ wxToolBar *tbar = (wxToolBar *)tool->GetToolBar();
+
+ if (tbar->m_blockEvent) return FALSE;
+
+ if (g_blockEventsOnDrag) return FALSE;
+ if (!tool->IsEnabled()) return FALSE;
+
+ wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tool->GetId() );
+ if ( tbar->HandleWindowEvent(evt) )
+ {
+ return TRUE;