wxClipboard *wxTheClipboard = (wxClipboard*) NULL;
-GdkAtom g_textAtom = 0;
GdkAtom g_clipboardAtom = 0;
GdkAtom g_targetsAtom = 0;
for (unsigned int i=0; i<selection_data->length/sizeof(GdkAtom); i++)
{
+ char *name = gdk_atom_name (atoms[i]);
+ if (name) printf( "Format available: %s.\n", name );
+
if (atoms[i] == clipboard->m_targetRequested)
{
clipboard->m_formatSupported = TRUE;
(gpointer) NULL );
if (!g_clipboardAtom) g_clipboardAtom = gdk_atom_intern( "CLIPBOARD", FALSE );
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "TEXT", FALSE );
if (!g_targetsAtom) g_targetsAtom = gdk_atom_intern ("TARGETS", FALSE);
m_formatSupported = FALSE;
/* Add handlers if someone requests data */
+
+#if (GTK_MINOR_VERSION > 0)
+
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ GDK_SELECTION_PRIMARY,
+ format,
+ 0 ); /* what is info ? */
+
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ g_clipboardAtom,
+ format,
+ 0 ); /* what is info ? */
+
+ gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
+ "selection_get",
+ GTK_SIGNAL_FUNC(selection_handler),
+ (gpointer) NULL );
+
+#else
+
gtk_selection_add_handler( m_clipboardWidget,
g_clipboardAtom,
format,
format,
selection_handler,
(gpointer) NULL );
+#endif
/* Tell the world we offer clipboard data */