/////////////////////////////////////////////////////////////////////////////
-// Name: tbargtk.cpp
+// Name: src/gtk/tbargtk.cpp
// Purpose: GTK toolbar
// Author: Robert Roebling
// Modified: 13.12.99 by VZ to derive from wxToolBarBase
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if wxUSE_TOOLBAR_NATIVE
+
#include "wx/toolbar.h"
-#if wxUSE_TOOLBAR_NATIVE
+#ifndef WX_PRECOMP
+ #include "wx/frame.h"
+#endif
-#include "wx/frame.h"
+// FIXME: Use GtkImage instead of GtkPixmap. Use the new toolbar API for when gtk runtime is new enough?
+// Beware that the new and old toolbar API may not be mixed in usage.
+#include <gtk/gtkversion.h>
+#ifdef GTK_DISABLE_DEPRECATED
+#undef GTK_DISABLE_DEPRECATED
+#endif
-#include <glib.h>
#include "wx/gtk/private.h"
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
-// idle system
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
-
// data
extern bool g_blockEventsOnDrag;
extern wxCursor g_globalCursor;
gtk_widget_show(GTK_WIDGET(m_toolbar));
}
- gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
-
// FIXME: there is no such function for toolbars in 2.0
#if 0
if (style & wxTB_FLAT)
gtk_toolbar_set_orientation(m_toolbar, orient);
gtk_toolbar_set_style(m_toolbar, style);
+ gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), !(style & wxTB_NO_TOOLTIPS) );
}
void wxToolBar::SetWindowStyleFlag( long style )
wxCHECK_MSG( bitmap.Ok(), false,
wxT("invalid bitmap for wxToolBar icon") );
- wxCHECK_MSG( bitmap.GetBitmap() == NULL, false,
+ wxCHECK_MSG( bitmap.GetDepth() != 1, false,
wxT("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,
return false;
}
- gtk_signal_connect( GTK_OBJECT(tool->m_item),
- "enter_notify_event",
- GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
- (gpointer)tool );
- gtk_signal_connect( GTK_OBJECT(tool->m_item),
- "leave_notify_event",
- GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
- (gpointer)tool );
+ 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);
}
break;
m_blockEvent = true;
- gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(item), toggle );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(item), toggle );
m_blockEvent = false;
}