+void wxToolBar::OnIdle( wxIdleEvent &WXUNUSED(ievent) )
+{
+ wxEvtHandler* evtHandler = GetEventHandler();
+
+ wxNode* node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool* tool = (wxToolBarTool*) node->Data();
+
+ wxUpdateUIEvent event( tool->m_index );
+ event.SetEventObject(this);
+
+ if (evtHandler->ProcessEvent( event ))
+ {
+ if (event.GetSetEnabled())
+ EnableTool(tool->m_index, event.GetEnabled());
+ if (event.GetSetChecked())
+ ToggleTool(tool->m_index, event.GetChecked());
+/*
+ if (event.GetSetText())
+ // Set tooltip?
+*/
+ }
+
+ node = node->Next();
+ }
+}
+
+void wxToolBar::OnInternalIdle()
+{
+ wxCursor cursor = m_cursor;
+ if (g_globalCursor.Ok()) cursor = g_globalCursor;
+
+ if (cursor.Ok())
+ {
+ /* I now set the cursor the anew in every OnInternalIdle call
+ as setting the cursor in a parent window also effects the
+ windows above so that checking for the current cursor is
+ not possible. */
+
+ if (HasFlag(wxTB_DOCKABLE))
+ {
+ /* if the toolbar is dockable, then m_widget stands for the
+ GtkHandleBox widget, which uses its own window so that we
+ can set the cursor for it. if the toolbar is not dockable,
+ m_widget comes from m_toolbar which uses its parent's
+ window ("windowless windows") and thus we cannot set the
+ cursor. */
+ gdk_window_set_cursor( m_widget->window, cursor.GetCursor() );
+ }
+
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ node = node->Next();
+
+ if (!tool->m_item || !tool->m_item->window)
+ continue;
+ else
+ gdk_window_set_cursor( tool->m_item->window, cursor.GetCursor() );
+ }
+ }
+
+ UpdateWindowUI();
+}