#include "gdk/gdk.h"
#include "gtk/gtk.h"
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
//-----------------------------------------------------------------------------
// wxMenuBar
//-----------------------------------------------------------------------------
{
if (*pc == _T('&'))
{
- pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
str << _T('_');
#endif
}
- str << *pc;
+ else
+ str << *pc;
}
/* this doesn't have much effect right now */
return wxNOT_FOUND;
}
-wxMenuItem *wxMenuBar::FindItemForId(int itemId, wxMenu **menuForItem = NULL) const
+wxMenuItem *wxMenuBar::FindItemForId(int itemId, wxMenu **menuForItem ) const
{
if ( menuForItem )
{
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
+ if (g_isIdle) wxapp_install_idle_handler();
+
int id = menu->FindMenuIdByMenuItem(widget);
/* should find it for normal (not popup) menu */
static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
{
+ if (g_isIdle) wxapp_install_idle_handler();
+
int id = menu->FindMenuIdByMenuItem(widget);
wxASSERT( id != -1 ); // should find it!
static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
{
+ if (g_isIdle) wxapp_install_idle_handler();
+
int id = menu->FindMenuIdByMenuItem(widget);
wxASSERT( id != -1 ); // should find it!
{
if (*pc == _T('&'))
{
- pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
m_text << _T('_');
#endif
}
- m_text << *pc;
+ else
+ m_text << *pc;
}
if (m_menuItem)
#else
- GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label( item.mb_str() )
- : gtk_menu_item_new_with_label( item.mb_str() );
+ GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label( mitem->GetText().mb_str() )
+ : gtk_menu_item_new_with_label( mitem->GetText().mb_str() );
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),