+// "activate"
+//-----------------------------------------------------------------------------
+
+static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
+{
+ int id = menu->FindMenuIdByMenuItem(widget);
+
+ /* should find it for normal (not popup) menu */
+ wxASSERT( (id != -1) || (menu->GetInvokingWindow() != NULL) );
+
+ if (!menu->IsEnabled(id)) return;
+
+ wxMenuItem* item = menu->FindItem( id );
+ wxCHECK_RET( item, "error in menu item callback" );
+
+ if (item->m_isCheckMenu)
+ {
+ if (item->m_isChecked == item->IsChecked())
+ {
+ /* the menu item has been checked by calling wxMenuItem->Check() */
+ return;
+ }
+ else
+ {
+ /* the user pressed on the menu item -> report */
+ item->m_isChecked = item->IsChecked(); /* make consistent again */
+ }
+ }
+
+ wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
+ event.SetEventObject( menu );
+ event.SetInt(id );
+
+ if (menu->m_callback)
+ {
+ (void) (*(menu->m_callback)) (*menu, event);
+ return;
+ }
+
+ if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
+ wxWindow *win = menu->GetInvokingWindow();
+ if (win) win->GetEventHandler()->ProcessEvent( event );
+}
+
+//-----------------------------------------------------------------------------
+// "select"
+//-----------------------------------------------------------------------------
+
+static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
+{
+ int id = menu->FindMenuIdByMenuItem(widget);
+
+ wxASSERT( id != -1 ); // should find it!
+
+ if (!menu->IsEnabled(id)) return;
+
+ wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, id );
+ event.SetEventObject( menu );
+
+/* wxMSW doesn't call callback here either
+
+ if (menu->m_callback)
+ {
+ (void) (*(menu->m_callback)) (*menu, event);
+ return;
+ }
+*/
+
+ if (menu->GetEventHandler()->ProcessEvent(event)) return;
+
+ wxWindow *win = menu->GetInvokingWindow();
+ if (win) win->GetEventHandler()->ProcessEvent( event );
+}
+
+//-----------------------------------------------------------------------------
+// "deselect"